-
Notifications
You must be signed in to change notification settings - Fork 66
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
feat(helper): set_embedding function for all frameworks #163
Conversation
Codecov Report
@@ Coverage Diff @@
## main #163 +/- ##
==========================================
+ Coverage 84.90% 85.70% +0.79%
==========================================
Files 24 25 +1
Lines 1166 1189 +23
==========================================
+ Hits 990 1019 +29
+ Misses 176 170 -6
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
def test_embedding_docs(framework, tmpdir): | ||
# works for DA | ||
embed_model = embed_models[framework]() | ||
docs = DocumentArray(generate_fashion_match(num_total=100)) | ||
set_embeddings(docs, embed_model) | ||
assert docs.embeddings.shape == (100, 32) | ||
|
||
# works for DAM | ||
dam = DocumentArrayMemmap(tmpdir) | ||
dam.extend(generate_fashion_match(num_total=42)) | ||
set_embeddings(dam, embed_model) | ||
assert dam.embeddings.shape == (42, 32) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bwanglzu could you add some pytest mark to allow gpu test on this as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay
No description provided.