-
Notifications
You must be signed in to change notification settings - Fork 30.9k
Adding support for array key in raw dictionnaries in ASR pipeline.
#16827
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
Conversation
|
The documentation is not available anymore as the PR was closed or merged. |
| ```py | ||
| >>> raw_audio_waveforms = [d["array"] for d in dataset[:4]["audio"]] | ||
| >>> speech_recognizer(raw_audio_waveforms) | ||
| >>> speech_recognizer(dataset[:4]["audio"]) |
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.
Nice! Could you update the es version 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.
Done !
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 fixing this!
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
…uggingface#16827) * Adding support for `array` key in raw dictionnaries in ASR pipeline. * ES . * Update src/transformers/pipelines/automatic_speech_recognition.py Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com> * Making it work by not popping `array` first. * Black 22.3 Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
What does this PR do?
Adding support for
arraykey in raw dictionnaries in ASR pipeline.This means we can simplify the Quicktour example to look again a bit
more what the old
ffmpegexample looked like.Even simpler code might be enabled by
huggingface/datasets#4180
in the future. We could then remove the
[:4]which is currently necessary to preventloading a huge audio in RAM upfront.
Performance-wise the iterator also enables using stuff like
batch_sizeandnum_workersin thepipeline object to get optimal performance (this will only show real differences on GPU which is not
included in this quicktour)
Fixes # (issue)
Before submitting
Pull Request section?
to it if that's the case.
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.
@patrickvonplaten
@sgugger