How can I stop whisper to translate my audio?

Hi, I have a script where I’m using the Whisper API to transcribe a mp3 file, and for some reason it translates my content. I can say something in English and it will return exactly what I said, but in another language like Portuguese or Russian or Bulgarian.
I already used the prompt “Do not translate” but it still translates randomly

Don’t use the prompt for instructions. It won’t work.

Since it wasn’t trained using instruction-following techniques, Whisper operates more like a base GPT model. It’s important to keep in mind that Whisper only considers the first 244 tokens of the prompt.

Set the language parameter to the language you want so it doesn’t have to predict it

language
string
Optional
The language of the input audio. Supplying the input language in ISO-639-1 format will improve accuracy and latency.

Last, instead use the prompt as a prefix to your transcript. You can use it to “push” the model towards the language & style that you want. You can also introduce words & abbreviations this way.

Do you want it to be casual and include the “uhhh”? Do you want it to recognize brand specific words / abbreviations?

transcribe(filepath, prompt=“ZyntriQix, Digique Plus, CynapseFive, VortiQore V8, EchoNix Array, OrbitalLink Seven, DigiFractal Matrix, PULSE, RAPT, B.R.I.C.K., Q.U.A.R.T.Z., F.L.I.N.T.”)

transcribe(filepath, prompt=“Umm, let me think like, hmm… Okay, here’s what I’m, like, thinking.”)

2 Likes