TIMBOVILL commited on
Commit
669fc35
·
verified ·
1 Parent(s): d0810b6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -12
app.py CHANGED
@@ -1557,19 +1557,19 @@ with gr.Blocks(theme=theme) as app:
1557
  )
1558
  dropbox.upload(fn=save_to_wav2, inputs=[dropbox], outputs=[input_audio0])
1559
  dropbox.upload(fn=change_choices2, inputs=[], outputs=[input_audio0])
1560
- refresh_button2 = gr.Button("Refresh", variant="primary", size='sm')
1561
  record_button.change(fn=save_to_wav, inputs=[record_button], outputs=[input_audio0])
1562
  record_button.change(fn=change_choices2, inputs=[], outputs=[input_audio0])
1563
- with gr.Row():
1564
- with gr.Accordion('ElevenLabs / Google TTS', open=False):
1565
- with gr.Column():
1566
- lang = gr.Radio(label='Chinese & Japanese do not work with ElevenLabs currently.',choices=['en','it','es','fr','pt','zh-CN','de','hi','ja'], value='en')
1567
- api_box = gr.Textbox(label="Enter your API Key for ElevenLabs, or leave empty to use GoogleTTS", value='')
1568
- elevenid=gr.Dropdown(label="Voice:", choices=eleven_voices)
1569
- with gr.Column():
1570
- tfs = gr.Textbox(label="Input your Text", interactive=True, value="This is a test.")
1571
- tts_button = gr.Button(value="Speak")
1572
- tts_button.click(fn=elevenTTS, inputs=[api_box,tfs, elevenid, lang], outputs=[record_button, input_audio0])
1573
  with gr.Row():
1574
  with gr.Accordion('Wav2Lip', open=False, visible=False):
1575
  with gr.Row():
@@ -1592,7 +1592,7 @@ with gr.Blocks(theme=theme) as app:
1592
  interactive=False,
1593
  )
1594
 
1595
- with gr.Accordion('TTS', open=True):
1596
  with gr.Column():
1597
  ilariaid=gr.Dropdown(label="Voice:", choices=ilariavoices, value="English-Jenny (Female)")
1598
  ilariatext = gr.Textbox(label="Input your Text", interactive=True, value="This is a test.")
@@ -1885,6 +1885,14 @@ with gr.Blocks(theme=theme) as app:
1885
  """
1886
  )
1887
 
 
 
 
 
 
 
 
 
1888
  def has_two_files_in_pretrained_folder():
1889
  pretrained_folder = "./pretrained/"
1890
  if not os.path.exists(pretrained_folder):
 
1557
  )
1558
  dropbox.upload(fn=save_to_wav2, inputs=[dropbox], outputs=[input_audio0])
1559
  dropbox.upload(fn=change_choices2, inputs=[], outputs=[input_audio0])
1560
+ refresh_button2 = gr.Button("Refresh", variant="secondary", size='sm')
1561
  record_button.change(fn=save_to_wav, inputs=[record_button], outputs=[input_audio0])
1562
  record_button.change(fn=change_choices2, inputs=[], outputs=[input_audio0])
1563
+ # with gr.Row():
1564
+ # with gr.Accordion('ElevenLabs / Google TTS', open=False):
1565
+ # with gr.Column():
1566
+ # lang = gr.Radio(label='Chinese & Japanese do not work with ElevenLabs currently.',choices=['en','it','es','fr','pt','zh-CN','de','hi','ja'], value='en')
1567
+ # api_box = gr.Textbox(label="Enter your API Key for ElevenLabs, or leave empty to use GoogleTTS", value='')
1568
+ # elevenid=gr.Dropdown(label="Voice:", choices=eleven_voices)
1569
+ # with gr.Column():
1570
+ # tfs = gr.Textbox(label="Input your Text", interactive=True, value="This is a test.")
1571
+ # tts_button = gr.Button(value="Speak")
1572
+ # tts_button.click(fn=elevenTTS, inputs=[api_box,tfs, elevenid, lang], outputs=[record_button, input_audio0])
1573
  with gr.Row():
1574
  with gr.Accordion('Wav2Lip', open=False, visible=False):
1575
  with gr.Row():
 
1592
  interactive=False,
1593
  )
1594
 
1595
+ with gr.Accordion('TTS', open=False):
1596
  with gr.Column():
1597
  ilariaid=gr.Dropdown(label="Voice:", choices=ilariavoices, value="English-Jenny (Female)")
1598
  ilariatext = gr.Textbox(label="Input your Text", interactive=True, value="This is a test.")
 
1885
  """
1886
  )
1887
 
1888
+ with gr.TabItem("Text To Speech"):
1889
+ with gr.Column():
1890
+ ilariaid=gr.Dropdown(label="Voice:", choices=ilariavoices, value="English-Jenny (Female)")
1891
+ ilariatext = gr.Textbox(label="Input your Text", interactive=True, value="This is a test.")
1892
+ ilariatts_button = gr.Button(value="Speak")
1893
+ ilariatts_button.click(fn=ilariaTTS, inputs=[ilariatext, ilariaid], outputs=[record_button, input_audio0])
1894
+ )
1895
+
1896
  def has_two_files_in_pretrained_folder():
1897
  pretrained_folder = "./pretrained/"
1898
  if not os.path.exists(pretrained_folder):