Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use cache for hf requests during CI #2379

Merged
merged 3 commits into from
Mar 31, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
increase all_close tolerance for milvus2, improve assertion infos
  • Loading branch information
tstadel committed Mar 30, 2022
commit 3d0e14852f5de19b340e560c0d3c2ce58ba42bc6
5 changes: 3 additions & 2 deletions test/test_faiss_and_milvus.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,6 @@ def test_faiss_passing_index_from_outside(tmp_path):
@pytest.mark.parametrize("document_store", ["faiss", "milvus1", "milvus", "weaviate"], indirect=True)
def test_cosine_similarity(document_store):
# below we will write documents to the store and then query it to see if vectors were normalized

ensure_ids_are_correct_uuids(docs=DOCUMENTS, document_store=document_store)
document_store.write_documents(documents=DOCUMENTS)

Expand All @@ -506,7 +505,9 @@ def test_cosine_similarity(document_store):
original_emb = indexed_docs[doc.content].astype("float32")

# check if the stored embedding was normalized
assert np.allclose(original_emb, result_emb, rtol=0.2) # high tolerance necessary for Milvus 2
np.testing.assert_allclose(
original_emb, result_emb, rtol=0.2, atol=5e-07
) # high tolerance necessary for Milvus 2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change comes from the other PR, is it? #2375

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, sorry for that! merging master into this branch should make it disappear.


# check if the score is plausible for cosine similarity
assert 0 <= doc.score <= 1.0
Expand Down