Skip to content

Commit

Permalink
typecheck passes for weaviate?
Browse files Browse the repository at this point in the history
  • Loading branch information
AmoghTantradi committed Jan 15, 2025
1 parent 3c8a742 commit ccd9e48
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lotus/vector_store/weaviate_vs.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,8 @@ def __call__(self,
for obj in objects:
indices.append(obj.properties.get('content'))
# Convert cosine distance to similarity score
distance:float = obj.metadata.distance
distances.append(1 - distance) # Convert distance to similarity

distance = obj.metadata.distance if obj.metadata and obj.metadata.distance is not None else 1.0
distances.append(1 - distance) # Convert distance to similarity
# Pad results if fewer than K matches
while len(indices) < K:
indices.append(-1)
Expand Down

0 comments on commit ccd9e48

Please sign in to comment.