3

When I use the open AI whisper model on Hindi audio, it returns the transcription in English instead of Hindi.

How do I get the output in Hindi itself? Is there a setting that can be changed?

mel = whisper.log_mel_spectrogram(audio).to(model.device)
options = whisper.DecodingOptions(language = 'hi')
result = whisper.decode(model, mel, options)
print(result.text)

Result:

enter image description here

Kos
  • 4,890
  • 9
  • 38
  • 42
  • If you are trying using the `base` model, try `large` or `medium`. The issue with wrong script for Hindi is already reported here: https://github.com/openai/whisper/discussions/118 – Gokul NC Oct 08 '22 at 14:40

1 Answers1

0

I recommend loading your model as for example base.hi.

Edit: Here's an example:

model = whisper.load_model('base.hi')
result = model.transcribe(file_path)
Parzival
  • 62
  • 5