auto translation?
cameronbergh opened this issue · 1 comments
I am fairly sure that this model is capable of translating non-english spoken language into english text. I think maybe we are missing a parameter perhaps? how can we make this translate non_english speech into english text?
I didn't add this as a parameter but Whisper does support translation.
You can change line 124 from:
result = audio_model.transcribe(temp_file, fp16=torch.cuda.is_available())
to
result = audio_model.transcribe(temp_file, fp16=torch.cuda.is_available(), task='translate')
and make sure you're using the generic model by passing in --non_english
as a parameter.
Whisper also supports specifying the language, which supposedly does a better job than the auto-language detect. You can pass in a language with the language argument:
result = audio_model.transcribe(temp_file, fp16=torch.cuda.is_available(), task='translate', language='es')
The languages available are listed here in the Whisper source.
These are features I added to my more complete GUI app, Transcriber.