Tonic commited on
Commit
49f03db
1 Parent(s): e58b4bb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -19,7 +19,7 @@ welcome_message = """
19
  Tonic's Unity On Device uses [facebook/seamless-m4t-unity-small](https://huggingface.co/facebook/seamless-m4t-unity-small) for audio translation & accessibility.
20
  Tonic's Unity On Device!🚀 on your own data & in your own way by cloning this space. Simply click here: <a style="display:inline-block" href="https://huggingface.co/spaces/TeamTonic/SeamlessOnDevice?duplicate=true"><img src="https://img.shields.io/badge/-Duplicate%20Space-blue?labelColor=white&style=flat&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAP5JREFUOE+lk7FqAkEURY+ltunEgFXS2sZGIbXfEPdLlnxJyDdYB62sbbUKpLbVNhyYFzbrrA74YJlh9r079973psed0cvUD4A+4HoCjsA85X0Dfn/RBLBgBDxnQPfAEJgBY+A9gALA4tcbamSzS4xq4FOQAJgCDwV2CPKV8tZAJcAjMMkUe1vX+U+SMhfAJEHasQIWmXNN3abzDwHUrgcRGmYcgKe0bxrblHEB4E/pndMazNpSZGcsZdBlYJcEL9Afo75molJyM2FxmPgmgPqlWNLGfwZGG6UiyEvLzHYDmoPkDDiNm9JR9uboiONcBXrpY1qmgs21x1QwyZcpvxt9NS09PlsPAAAAAElFTkSuQmCC&logoWidth=14" alt="Duplicate Space"></a></h3>
21
  ### Join us :
22
- TeamTonic is always making cool demos! Join our active builder's community on Discord: [Discord](https://discord.gg/GWpVpekp) On 🤗Huggingface: [TeamTonic](https://huggingface.co/TeamTonic) & [MultiTransformer](https://huggingface.co/MultiTransformer) On 🌐Github: [Polytonic](https://github.com/tonic-ai) & contribute to 🌟 [PolyGPT](https://github.com/tonic-ai/polygpt-alpha)"
23
  """
24
 
25
  def save_and_resample_audio(input_audio_path, output_audio_path, resample_rate=16000):
@@ -79,6 +79,7 @@ def create_interface():
79
  text_output_stt = gr.Text(label="Transcribed Text")
80
  stt_button = gr.Button("Transcribe")
81
  stt_button.click(speech_to_text, inputs=[audio_input_stt, input_language], outputs=text_output_stt)
 
82
 
83
  with gr.Accordion("Speech to Speech Translation", open=False) as s2st_accordion:
84
  audio_input_s2st = gr.Audio(label="Upload or Record Audio")
@@ -86,6 +87,7 @@ def create_interface():
86
  audio_output_s2st = gr.Audio(label="Translated Audio", type="filepath")
87
  s2st_button = gr.Button("Translate")
88
  s2st_button.click(speech_to_speech_translation, inputs=[audio_input_s2st, input_language], outputs=[text_output_s2st, audio_output_s2st])
 
89
 
90
  return interface
91
 
 
19
  Tonic's Unity On Device uses [facebook/seamless-m4t-unity-small](https://huggingface.co/facebook/seamless-m4t-unity-small) for audio translation & accessibility.
20
  Tonic's Unity On Device!🚀 on your own data & in your own way by cloning this space. Simply click here: <a style="display:inline-block" href="https://huggingface.co/spaces/TeamTonic/SeamlessOnDevice?duplicate=true"><img src="https://img.shields.io/badge/-Duplicate%20Space-blue?labelColor=white&style=flat&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAP5JREFUOE+lk7FqAkEURY+ltunEgFXS2sZGIbXfEPdLlnxJyDdYB62sbbUKpLbVNhyYFzbrrA74YJlh9r079973psed0cvUD4A+4HoCjsA85X0Dfn/RBLBgBDxnQPfAEJgBY+A9gALA4tcbamSzS4xq4FOQAJgCDwV2CPKV8tZAJcAjMMkUe1vX+U+SMhfAJEHasQIWmXNN3abzDwHUrgcRGmYcgKe0bxrblHEB4E/pndMazNpSZGcsZdBlYJcEL9Afo75molJyM2FxmPgmgPqlWNLGfwZGG6UiyEvLzHYDmoPkDDiNm9JR9uboiONcBXrpY1qmgs21x1QwyZcpvxt9NS09PlsPAAAAAElFTkSuQmCC&logoWidth=14" alt="Duplicate Space"></a></h3>
21
  ### Join us :
22
+ TeamTonic is always making cool demos! Join our active builder's community on Discord: [Discord](https://discord.gg/GWpVpekp) On Huggingface: [TeamTonic](https://huggingface.co/TeamTonic) & [MultiTransformer](https://huggingface.co/MultiTransformer) On Github: [Polytonic](https://github.com/tonic-ai) & contribute to [PolyGPT](https://github.com/tonic-ai/polygpt-alpha)"
23
  """
24
 
25
  def save_and_resample_audio(input_audio_path, output_audio_path, resample_rate=16000):
 
79
  text_output_stt = gr.Text(label="Transcribed Text")
80
  stt_button = gr.Button("Transcribe")
81
  stt_button.click(speech_to_text, inputs=[audio_input_stt, input_language], outputs=text_output_stt)
82
+ gr.Examples([["audio1.wav"]], inputs=[audio_input_stt], outputs=[text_output_stt])
83
 
84
  with gr.Accordion("Speech to Speech Translation", open=False) as s2st_accordion:
85
  audio_input_s2st = gr.Audio(label="Upload or Record Audio")
 
87
  audio_output_s2st = gr.Audio(label="Translated Audio", type="filepath")
88
  s2st_button = gr.Button("Translate")
89
  s2st_button.click(speech_to_speech_translation, inputs=[audio_input_s2st, input_language], outputs=[text_output_s2st, audio_output_s2st])
90
+ gr.Examples([["audio1.wav"]], inputs=[audio_input_s2st], outputs=[text_output_s2st, audio_output_s2st])
91
 
92
  return interface
93