Skip to content

Commit

Permalink
fix: pass the mypy check.
Browse files Browse the repository at this point in the history
  • Loading branch information
keli-wen committed Jan 29, 2025
1 parent 2d65ae3 commit 03874b5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion camel/utils/deduplication.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def deduplicate_internally(
embeddings = embedding_instance.embed_list(texts)
else:
# Use pre-supplied embeddings.
if len(embeddings) != len(texts):
if embeddings and len(embeddings) != len(texts):
raise ValueError(
"The length of 'embeddings' does not match the length "
"of 'texts'."
Expand Down Expand Up @@ -184,6 +184,8 @@ def deduplicate_internally(
unique_ids = []
unique_embeddings_dict = {}

assert embeddings, "embeddings must be valid"

for i, (_, emb) in enumerate(zip(texts, embeddings)):
if i not in duplicate_to_target_map:
unique_ids.append(i)
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -535,5 +535,6 @@ module = [
"tree-sitter",
"ragas",
"pandasai",
"sklearn.metrics.pairwise",
]
ignore_missing_imports = true

0 comments on commit 03874b5

Please sign in to comment.