owaski commited on
Commit
86a7a75
·
1 Parent(s): fc801e4

fix language id

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -59,6 +59,7 @@ def predict(audio, src_language, tgt_language, mic_audio=None):
59
  src_language = None
60
  else:
61
  src_language = language_id_lookup[src_language.split()[0]]
 
62
 
63
  # Runs the audio through the whisper model and gets the DecodingResult object, which has the features:
64
  # audio_features (Tensor), language, language_probs, tokens, text, avg_logprob, no_speech_prob, temperature, compression_ratio
@@ -135,7 +136,7 @@ gr.Interface(
135
  # To change to output audio, replace the outputs line with
136
  # outputs=gr.outputs.Audio(type="numpy", label=None)
137
  outputs=[
138
- gr.Text(label="Transcription"),
139
  ],
140
  title=title,
141
  description=description,
 
59
  src_language = None
60
  else:
61
  src_language = language_id_lookup[src_language.split()[0]]
62
+ tgt_language = language_id_lookup[tgt_language.split()[0]]
63
 
64
  # Runs the audio through the whisper model and gets the DecodingResult object, which has the features:
65
  # audio_features (Tensor), language, language_probs, tokens, text, avg_logprob, no_speech_prob, temperature, compression_ratio
 
136
  # To change to output audio, replace the outputs line with
137
  # outputs=gr.outputs.Audio(type="numpy", label=None)
138
  outputs=[
139
+ gr.Text(label="Translation"),
140
  ],
141
  title=title,
142
  description=description,