susnato commited on
Commit
bd4d054
1 Parent(s): 6e8e13a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -32,7 +32,7 @@ def synthesise(text):
32
  return speech.cpu()
33
 
34
 
35
- def speech_to_speech_translation(audio):
36
  translated_text = translate(audio)
37
  synthesised_speech = synthesise(translated_text)
38
  synthesised_speech = (synthesised_speech.numpy() * 32767).astype(np.int16)
@@ -50,7 +50,7 @@ Demo for cascaded speech-to-speech translation (STST), mapping from source speec
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,
@@ -58,7 +58,7 @@ mic_translate = gr.Interface(
58
  )
59
 
60
  file_translate = gr.Interface(
61
- fn=speech_to_speech_translation,
62
  inputs=gr.Audio(source="upload", type="filepath"),
63
  outputs=gr.Audio(label="Generated Speech", type="numpy"),
64
  examples=[["./example.wav"]],
 
32
  return speech.cpu()
33
 
34
 
35
+ def speech_to_hindi_translation(audio):
36
  translated_text = translate(audio)
37
  synthesised_speech = synthesise(translated_text)
38
  synthesised_speech = (synthesised_speech.numpy() * 32767).astype(np.int16)
 
50
  demo = gr.Blocks()
51
 
52
  mic_translate = gr.Interface(
53
+ fn=speech_to_hindi_translation,
54
  inputs=gr.Audio(source="microphone", type="filepath"),
55
  outputs=gr.Audio(label="Generated Speech", type="numpy"),
56
  title=title,
 
58
  )
59
 
60
  file_translate = gr.Interface(
61
+ fn=speech_to_hindi_translation,
62
  inputs=gr.Audio(source="upload", type="filepath"),
63
  outputs=gr.Audio(label="Generated Speech", type="numpy"),
64
  examples=[["./example.wav"]],