-
Notifications
You must be signed in to change notification settings - Fork 114
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
Follow up PR for Audio End to End testing #390
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #390 +/- ##
=======================================
Coverage 78.99% 78.99%
=======================================
Files 37 37
Lines 2804 2804
=======================================
Hits 2215 2215
Misses 589 589 ☔ View full report in Codecov by Sentry. |
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.
PR Summary
This PR enhances the audio embeddings functionality in the infinity_emb library, addressing issue #378 by improving support for mixed input types and expanding test coverage.
- Modified
AudioEmbeddingInput
inpymodels.py
to accept both text and URL inputs - Extended
_embeddings_audio
function ininfinity_server.py
to process mixed input types (audio URLs and text) - Added new tests in
test_torch_audio.py
for text-only input, mixed text/URL input, and embedding comparisons - Implemented cosine similarity function for comparing audio embeddings
- Removed skip decorator from text-only test, improving overall test coverage
3 file(s) reviewed, 3 comment(s)
Edit PR Review Bot Settings
assert cosine_similarity( | ||
embeddings_audio_beep, embeddings_text_beep | ||
) > cosine_similarity(embeddings_audio_beep, embeddings_text_fish) | ||
assert cosine_similarity( | ||
embeddings_audio_beep, embeddings_text_beep | ||
) > cosine_similarity(embeddings_audio_beep, embeddings_text_horse) |
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.
style: Add a small tolerance to comparisons to account for floating-point precision
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.
Just a greater than is fine here I guess
@wirthual Wait, I am confused - the “/embeddings” endpoint already works for audio! |
Isnt the |
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.
LGTM, thanks for the contribution! Feel free to merge once all test are passing.
#378 This PR adds support for handing text and urls for the audio embeddings endpoint.
Extended the test to test text only, mixed text and urls and also check a meta test for the embeddings.
Implemented for the audio endpoint, if this scheme is acceptable happy to port it to the vision endpoint.
Cheers