-
Notifications
You must be signed in to change notification settings - Fork 31.7k
[voxtral] language detection + skipping lang:xx #41225
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 docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
|
run-slow: voxtral |
ArthurZucker
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.
Nice catch 🤗
| lang_prefix = "lang:xx" | ||
| if skip_special_tokens and decoded_string.startswith("lang:"): | ||
| decoded_string = decoded_string[len(lang_prefix) :] | ||
|
|
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.
if it always starts with it (no other token in between) fine, otherwise would use regex
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.
it should! but just in case I switched to using regex
|
[For maintainers] Suggested jobs to run (before merge) run-slow: voxtral |
* proc + doc update * improve doc * add lang:xx in decode * update voxtral test * nit * nit * update test value * use regex
* proc + doc update * improve doc * add lang:xx in decode * update voxtral test * nit * nit * update test value * use regex
What does this PR do?
Adds the possibility of setting
language=Noneinapply_transcription_requestfor automatic language detection.Note
This is not breaking. Instead of being required,
languageis now optional.It was a bit hidden, but Voxtral supports language detection by omitting the language token, e.g.
see here:
Other update
Important
🚨 In the specific case of Voxtral, the added
f"lang:xx"(always a two char language code since it follows ISO 639-1 alpha-2 format) is not considered as a special token bymistral-commonand is encoded/ decoded as normal text.Nevertheless we should remove it to ease users life.
Added:
MistralCommonTokenizer'sdecodetest_decode_transcription_mode