Aki004 commited on
Commit
215fe46
1 Parent(s): 766a0d1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -10
app.py CHANGED
@@ -38,16 +38,17 @@ def tts_mode(txt, voice):
38
 
39
  return audio_bytes
40
 
41
- loop = asyncio.new_event_loop()
42
- asyncio.set_event_loop(loop)
43
- with gr.Blocks() as app:
44
- with gr.Tabs():
45
- with gr.TabItem('Herta'):
46
- tts_text = gr.Textbox(label="TTS text (100 words limitation)", visible = True)
47
- tts_voice = gr.Dropdown(choices= tts_get_voices_list(), visible = True)
48
- audio_output = gr.Audio(label="Output Audio")
49
- btn_submit = gr.Button("Generate")
 
50
 
51
  btn_submit.click(tts_mode, [tts_text, tts_voice], [audio_output])
52
 
53
- app.launch()
 
38
 
39
  return audio_bytes
40
 
41
+ if __name__ == '__main__':
42
+ loop = asyncio.new_event_loop()
43
+ asyncio.set_event_loop(loop)
44
+ with gr.Blocks() as app:
45
+ with gr.Tabs():
46
+ with gr.TabItem('Herta'):
47
+ tts_text = gr.Textbox(label="TTS text (100 words limitation)", visible = True)
48
+ tts_voice = gr.Dropdown(choices= tts_get_voices_list(), visible = True)
49
+ audio_output = gr.Audio(label="Output Audio")
50
+ btn_submit = gr.Button("Generate")
51
 
52
  btn_submit.click(tts_mode, [tts_text, tts_voice], [audio_output])
53
 
54
+ app.launch()