philipp-zettl commited on
Commit
9b3519c
·
verified ·
1 Parent(s): 005ab87

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -16,7 +16,7 @@ def transcribe(filepath):
16
  # Assuming the file is named 'audio.wav'
17
  # Run the transcription
18
  transcript = asr_pipeline(filepath)
19
- return transcript, tokenizer.decode(translation_model.generate(**tokenizer(transcript['text'], return_tensors="pt", padding=True))[0], skip_special_tokens=True)
20
 
21
 
22
  demo = gr.Interface(fn=transcribe, inputs=[gr.Audio(type='filepath')], outputs=[gr.Text("transcript"), gr.Text("translation")])
 
16
  # Assuming the file is named 'audio.wav'
17
  # Run the transcription
18
  transcript = asr_pipeline(filepath)
19
+ return transcript, tokenizer.decode(translation_model(**tokenizer(transcript['text'], return_tensors="pt", padding=True))[0], skip_special_tokens=True)
20
 
21
 
22
  demo = gr.Interface(fn=transcribe, inputs=[gr.Audio(type='filepath')], outputs=[gr.Text("transcript"), gr.Text("translation")])