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

[WIP] Add language selection for streaming with whisper + Improve tests #48

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

AudranBert
Copy link
Member

@AudranBert AudranBert commented Nov 22, 2024

Add language selection for streaming with whisper, by default it will take the language found in the env settings. But you can pass a language in the config when starting streaming.

The PR is also improving tests to add tests about languages. Also removing some useless ones in order to reduce testing duration.

It also adds the possibility to pass a language in the config in case of offline decoding. It will enable having a same model instance used for multiple languages instead of launching another Docker.

@@ -43,17 +44,20 @@ async def wssDecode(ws: WebSocketServerProtocol, model_and_alignementmodel):
try:
config = json.loads(res)["config"]
sample_rate = config["sample_rate"]
language = config.get("language", None)
Copy link
Member

@Jeronymous Jeronymous Nov 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we need to update the doc, specifying the language can be specified in the configuration of the streaming request?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, why not to support language="*" (as in the env variable for the language in offline decoding)
that would need to replace "*" by None when reading the config

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we need to update the doc, specifying the language can be specified in the configuration of the streaming request?

Yes I need to update the doc

@damienlaine
Copy link
Member

Could you clarify the list of supported languages? For example, does it include "en," "fr," etc.? On the LinTO side, we consistently use BCP-47 codes for language representation.
Parsers (env, API directives...) shall at least support BCP-47 codes as inputs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add language selection for offline transcription with whisper models
3 participants