Skip to content

Commit

Permalink
fix hashing
Browse files Browse the repository at this point in the history
  • Loading branch information
zzstoatzz committed Aug 31, 2024
1 parent 6d6089d commit ba7be56
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion examples/refresh_chroma/refresh_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ async def refresh_chroma(
await chroma.reset_collection()
docs = await chroma.add(documents)
elif mode == "upsert":
docs = await chroma.upsert(documents)
docs = await task(chroma.upsert)(documents)
else:
raise ValueError(f"Unknown mode: {mode!r} (expected 'upsert' or 'reset')")

Expand Down
2 changes: 1 addition & 1 deletion src/raggy/documents.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,4 +130,4 @@ async def _create_excerpt(

def get_distinct_documents(documents: Iterable["Document"]) -> Iterable["Document"]:
"""Return a list of distinct documents."""
return distinct(documents, key=lambda doc: doc.hash)
return distinct(documents, key=lambda doc: hash(doc.text))

0 comments on commit ba7be56

Please sign in to comment.