DenBor commited on
Commit
2f0d0f4
1 Parent(s): 831a061

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -10
app.py CHANGED
@@ -22,7 +22,7 @@ speaker_embeddings = torch.tensor(embeddings_dataset[7306]["xvector"]).unsqueeze
22
 
23
 
24
  def translate(audio):
25
- outputs = asr_pipe(audio, max_new_tokens=256, generate_kwargs={"task": "translate", "language": "pl"})
26
  return outputs["text"]
27
 
28
 
@@ -49,13 +49,13 @@ Demo for cascaded speech-to-speech translation (STST), mapping from source speec
49
 
50
  demo = gr.Blocks()
51
 
52
- mic_translate = gr.Interface(
53
- fn=speech_to_speech_translation,
54
- inputs=gr.Audio(source="microphone", type="filepath"),
55
- outputs=gr.Audio(label="Generated Speech", type="numpy"),
56
- title=title,
57
- description=description,
58
- )
59
 
60
  file_translate = gr.Interface(
61
  fn=speech_to_speech_translation,
@@ -67,6 +67,6 @@ file_translate = gr.Interface(
67
  )
68
 
69
  with demo:
70
- gr.TabbedInterface([mic_translate, file_translate], ["Microphone", "Audio File"])
71
 
72
- demo.launch(share=True)
 
22
 
23
 
24
  def translate(audio):
25
+ outputs = asr_pipe(audio, max_new_tokens=256, generate_kwargs={"task": "transcribe", "language": "pl"})
26
  return outputs["text"]
27
 
28
 
 
49
 
50
  demo = gr.Blocks()
51
 
52
+ # mic_translate = gr.Interface(
53
+ # fn=speech_to_speech_translation,
54
+ # inputs=gr.Audio(source="microphone", type="filepath"),
55
+ # outputs=gr.Audio(label="Generated Speech", type="numpy"),
56
+ # title=title,
57
+ # description=description,
58
+ # )
59
 
60
  file_translate = gr.Interface(
61
  fn=speech_to_speech_translation,
 
67
  )
68
 
69
  with demo:
70
+ gr.TabbedInterface([file_translate], ["Audio File"])
71
 
72
+ demo.launch()