Skip to content
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

Support mixed-language batches in WhisperGenerationMixin #29685

Closed
cifkao opened this issue Mar 15, 2024 · 1 comment · Fixed by #29688
Closed

Support mixed-language batches in WhisperGenerationMixin #29685

cifkao opened this issue Mar 15, 2024 · 1 comment · Fixed by #29688
Labels
Audio Feature request Request for a new feature

Comments

@cifkao
Copy link
Contributor

cifkao commented Mar 15, 2024

Feature request

It is currently not possible to mix multiple languages in a single batch when running Whisper. The language argument only accepts a single string (as opposed to a separate language for each batch item), and if no language is passed and multiple languages are detected, transcription will fail.

I propose to enable passing a list of languages (language: Optional[Union[str, List[str]]]) in a batched transcription situation, as well as removing the restriction related to language detection.

Motivation

Not being able to transcribe multiple languages in a single batch is clearly a limitation, especially when relying on auto-detection, but also in scenarios where the language is known.

The error message states that It is currently not supported to transcribe to different languages in a single batch., implying that it could be supported at some point.

Your contribution

I have implemented this and I'm planning to submit a PR.

@amyeroberts
Copy link
Collaborator

cc @ylacombe @sanchit-gandhi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Audio Feature request Request for a new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants