-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
[Bugfix][Frontend] support webm with audioread fallback #18477
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
base: main
Are you sure you want to change the base?
Conversation
c667ae0
to
8529fe5
Compare
👋 Hi! Thank you for contributing to the vLLM project. 💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels. Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging. To run CI, PR reviewers can either: Add 🚀 |
Btw, i tried to make minimal change to the code, yet the code in the main branch falls short of the pre-commit check, such as the import sorting... |
@NickLucche does this look good to you? |
Let me tidy up a bit the git history |
Signed-off-by: cpwan <[email protected]>
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 taking action on the issue.
To be frank I am not familiar with audioread, but I see librosa already uses it as a fallback so maybe this doesn't even go into the requirements lists.
librosa uses soundfile and audioread for reading audio. As of v0.7, librosa uses soundfile by default, and falls back on audioread only when dealing with codecs unsupported by soundfile. For a list of codecs supported by soundfile, see the libsndfile documentation.
Also I am totally uneducated on potential security concerns in opening up to a matrioska format like webm (cc @russellb ).
Can we at least test for the sake of completeness sending some video/image in webm?
try: | ||
with io.BytesIO(audio_data) as bytes_: | ||
out = librosa.load(bytes_, sr=None) | ||
except Exception: |
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.
this exception is way too generic
with io.BytesIO(audio_data) as bytes_: | ||
out = librosa.load(bytes_, sr=None) | ||
except Exception: | ||
with tempfile.NamedTemporaryFile() as temp: |
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.
we should write to a bytesio in memory buffer not a temp file. This may, among other things, trigger permissions issues on deployments.
out = librosa.load(bytes_, sr=None) | ||
except Exception: | ||
with tempfile.NamedTemporaryFile() as temp: | ||
temp.write(audio_data) |
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.
we should probably log debug/warning this path
Also worth to look into why librosa isn't falling back to audioread as reported in the docs, is it an optional dep or..? |
FIX #18385