-
-
Notifications
You must be signed in to change notification settings - Fork 11.1k
Multimodal - audio tests #25285
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
Multimodal - audio tests #25285
Conversation
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.
Code Review
This pull request introduces unit tests for audio processing functionalities in vllm/multimodal/audio.py. The tests are well-structured, covering resampling and media I/O operations with appropriate mocking. My review identifies a critical gap in the test coverage for resample_audio_scipy. The current tests only validate scenarios with integer resampling ratios, failing to detect a bug in the implementation that causes incorrect resampling for non-integer ratios. I've suggested an additional test case to expose and address this correctness issue.
DarkLight1337
left a comment
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.
Thanks for adding these tests!
Make sure you run pip-compile to update the requirements/test.txt file
|
spicy is already added to requirements/test.txt. so I removed it from requirements/test.in. |
Signed-off-by: Debolina Roy <debroy@redhat.com>
Signed-off-by: Debolina Roy <debroy@redhat.com>
Signed-off-by: Debolina Roy <debroy@redhat.com>
Signed-off-by: Debolina Roy <debroy@redhat.com>
Signed-off-by: Debolina Roy <debroy@redhat.com>
Signed-off-by: Debolina Roy <debroy@redhat.com>
Signed-off-by: Debolina Roy <debroy@redhat.com>
Signed-off-by: Debolina Roy <debroy@redhat.com>
Signed-off-by: Debolina Roy <debroy@redhat.com>
Signed-off-by: Debolina Roy <debroy@redhat.com>
Signed-off-by: Debolina Roy <debroy@redhat.com>
Signed-off-by: Debolina Roy <debroy@redhat.com>
Signed-off-by: Debolina Roy <debroy@redhat.com>
Signed-off-by: Debolina Roy <debroy@redhat.com>
Signed-off-by: Debolina Roy <debroy@redhat.com> Signed-off-by: charlifu <charlifu@amd.com>
Signed-off-by: Debolina Roy <debroy@redhat.com> Signed-off-by: yewentao256 <zhyanwentao@126.com>
Signed-off-by: Debolina Roy <debroy@redhat.com> Signed-off-by: xuebwang-amd <xuebwang@amd.com>
Signed-off-by: Debolina Roy <debroy@redhat.com>
Signed-off-by: Debolina Roy <debroy@redhat.com>
Signed-off-by: Debolina Roy <debroy@redhat.com> Signed-off-by: xuebwang-amd <xuebwang@amd.com>
Test Plan:
Unit tests for - vllm/multimodal/audio.py
The tests validate audio resampling (librosa, scipy) and ensure AudioResampler correctly delegates to the right backend, raises errors for invalid methods, and enforces target sample rates. They also verify AudioMediaIO can load audio from bytes, base64, and file paths, and encode audio to base64, with external libraries mocked (librosa, soundfile). Assertions check correct function calls, expected outputs, and error handling.