mrfakename commited on
Commit
ee22100
1 Parent(s): 9dd70a7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -4
app.py CHANGED
@@ -269,6 +269,7 @@ model_licenses = {
269
  'pheme': 'CC-BY',
270
  'speecht5': 'MIT',
271
  'metavoice': 'Apache 2.0',
 
272
  }
273
  model_links = {
274
  'styletts2': 'https://github.com/yl4579/StyleTTS2',
@@ -372,7 +373,13 @@ def reload(chosenmodel1=None, chosenmodel2=None, userid=None):
372
  # if chosenmodel2: out.append(f'This model was {chosenmodel2}')
373
  # return out
374
  # return (f'This model was {chosenmodel1}', f'This model was {chosenmodel2}', gr.update(visible=False), gr.update(visible=False))
375
- return (gr.update(variant='secondary', value=chosenmodel1, interactive=False), gr.update(variant='secondary', value=chosenmodel2, interactive=False))
 
 
 
 
 
 
376
 
377
  with gr.Blocks() as leaderboard:
378
  gr.Markdown(LDESC)
@@ -468,20 +475,20 @@ with gr.Blocks() as vote:
468
  with gr.Row(visible=False) as r2:
469
  with gr.Column():
470
  with gr.Group():
471
- # prevmodel1 = gr.Textbox(interactive=False, show_label=False, container=False, value="Vote to reveal model A", text_align="center", lines=1, max_lines=1)
472
  aud1 = gr.Audio(interactive=False, show_label=False, show_download_button=False, show_share_button=False, waveform_options={'waveform_progress_color': '#3C82F6'})
473
  abetter = gr.Button("A is better", variant='primary')
 
474
  with gr.Column():
475
  with gr.Group():
476
- # prevmodel2 = gr.Textbox(interactive=False, show_label=False, container=False, value="Vote to reveal model B", text_align="center", lines=1, max_lines=1)
477
  aud2 = gr.Audio(interactive=False, show_label=False, show_download_button=False, show_share_button=False, waveform_options={'waveform_progress_color': '#3C82F6'})
478
  bbetter = gr.Button("B is better", variant='primary')
 
479
  # outputs = [text, btn, r2, model1, model2, prevmodel1, aud1, prevmodel2, aud2, abetter, bbetter]
480
  outputs = [text, btn, r2, model1, model2, aud1, aud2, abetter, bbetter]
481
  btn.click(synthandreturn, inputs=[text], outputs=outputs)
482
 
483
  # nxt_outputs = [prevmodel1, prevmodel2, abetter, bbetter]
484
- nxt_outputs = [abetter, bbetter]
485
  abetter.click(a_is_better, outputs=nxt_outputs, inputs=[model1, model2, useridstate])
486
  bbetter.click(b_is_better, outputs=nxt_outputs, inputs=[model1, model2, useridstate])
487
  # skipbtn.click(b_is_better, outputs=outputs, inputs=[model1, model2, useridstate])
 
269
  'pheme': 'CC-BY',
270
  'speecht5': 'MIT',
271
  'metavoice': 'Apache 2.0',
272
+ 'elevenlabs': 'Proprietary',
273
  }
274
  model_links = {
275
  'styletts2': 'https://github.com/yl4579/StyleTTS2',
 
373
  # if chosenmodel2: out.append(f'This model was {chosenmodel2}')
374
  # return out
375
  # return (f'This model was {chosenmodel1}', f'This model was {chosenmodel2}', gr.update(visible=False), gr.update(visible=False))
376
+ # return (gr.update(variant='secondary', value=chosenmodel1, interactive=False), gr.update(variant='secondary', value=chosenmodel2, interactive=False))
377
+ return (
378
+ gr.update(interactive=False, visible=False),
379
+ gr.update(interactive=False, visible=False),
380
+ gr.update(value=chosenmodel1, interactive=False, visible=True),
381
+ gr.update(value=chosenmodel2, interactive=False, visible=True),
382
+ )
383
 
384
  with gr.Blocks() as leaderboard:
385
  gr.Markdown(LDESC)
 
475
  with gr.Row(visible=False) as r2:
476
  with gr.Column():
477
  with gr.Group():
 
478
  aud1 = gr.Audio(interactive=False, show_label=False, show_download_button=False, show_share_button=False, waveform_options={'waveform_progress_color': '#3C82F6'})
479
  abetter = gr.Button("A is better", variant='primary')
480
+ prevmodel1 = gr.Textbox(interactive=False, show_label=False, container=False, value="Vote to reveal model A", text_align="center", lines=1, max_lines=1)
481
  with gr.Column():
482
  with gr.Group():
 
483
  aud2 = gr.Audio(interactive=False, show_label=False, show_download_button=False, show_share_button=False, waveform_options={'waveform_progress_color': '#3C82F6'})
484
  bbetter = gr.Button("B is better", variant='primary')
485
+ prevmodel2 = gr.Textbox(interactive=False, show_label=False, container=False, value="Vote to reveal model B", text_align="center", lines=1, max_lines=1)
486
  # outputs = [text, btn, r2, model1, model2, prevmodel1, aud1, prevmodel2, aud2, abetter, bbetter]
487
  outputs = [text, btn, r2, model1, model2, aud1, aud2, abetter, bbetter]
488
  btn.click(synthandreturn, inputs=[text], outputs=outputs)
489
 
490
  # nxt_outputs = [prevmodel1, prevmodel2, abetter, bbetter]
491
+ nxt_outputs = [abetter, bbetter, prevmodel1, prevmodel2]
492
  abetter.click(a_is_better, outputs=nxt_outputs, inputs=[model1, model2, useridstate])
493
  bbetter.click(b_is_better, outputs=nxt_outputs, inputs=[model1, model2, useridstate])
494
  # skipbtn.click(b_is_better, outputs=outputs, inputs=[model1, model2, useridstate])