Spaces:
Running
on
Zero
Running
on
Zero
mrfakename
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -156,7 +156,7 @@ INSTR = """
|
|
156 |
* Vote on which synthesized audio sounds more natural to you
|
157 |
* Repeat!
|
158 |
|
159 |
-
**When you're ready to begin,
|
160 |
""".strip()
|
161 |
request = ''
|
162 |
if SPACE_ID:
|
@@ -438,7 +438,6 @@ def synthandreturn(text):
|
|
438 |
return (
|
439 |
text,
|
440 |
"Synthesize",
|
441 |
-
gr.update(visible=True), # r1
|
442 |
gr.update(visible=True), # r2
|
443 |
mdl1, # model1
|
444 |
mdl2, # model2
|
@@ -463,25 +462,21 @@ with gr.Blocks() as vote:
|
|
463 |
with gr.Group():
|
464 |
text = gr.Textbox(label="Enter text to synthesize", info="By entering text, you certify that it is either in the public domain or, if you are its author, you dedicate it into the public domain. You also must agree to the privacy statement in the About page.")
|
465 |
btn = gr.Button("Synthesize", variant='primary')
|
466 |
-
with gr.Row(visible=False) as r1:
|
467 |
-
gr.HTML('<div align="left"><h3>Model A</h3></div>')
|
468 |
-
gr.HTML('<div align="right"><h3>Model B</h3></div>')
|
469 |
model1 = gr.Textbox(interactive=False, lines=1, max_lines=1, visible=False)
|
470 |
model2 = gr.Textbox(interactive=False, lines=1, max_lines=1, visible=False)
|
471 |
with gr.Group(visible=False) as r2:
|
472 |
with gr.Row():
|
473 |
with gr.Column():
|
474 |
with gr.Group():
|
475 |
-
prevmodel1 = gr.Textbox(interactive=False, show_label=False, container=False, value="Vote to reveal model A", lines=1, max_lines=1)
|
476 |
aud1 = gr.Audio(interactive=False, show_label=False, show_download_button=False, show_share_button=False, waveform_options={'waveform_progress_color': '#3C82F6'})
|
|
|
477 |
with gr.Column():
|
478 |
with gr.Group():
|
479 |
-
prevmodel2 = gr.Textbox(interactive=False, show_label=False, container=False, value="Vote to reveal model B", text_align="
|
480 |
aud2 = gr.Audio(interactive=False, show_label=False, show_download_button=False, show_share_button=False, waveform_options={'waveform_progress_color': '#3C82F6'})
|
481 |
-
|
482 |
-
|
483 |
-
bbetter = gr.Button("B is Better")
|
484 |
-
outputs = [text, btn, r1, r2, model1, model2, prevmodel1, aud1, prevmodel2, aud2, abetter, bbetter]
|
485 |
btn.click(synthandreturn, inputs=[text], outputs=outputs)
|
486 |
|
487 |
nxt_outputs = [prevmodel1, prevmodel2, abetter, bbetter]
|
|
|
156 |
* Vote on which synthesized audio sounds more natural to you
|
157 |
* Repeat!
|
158 |
|
159 |
+
**When you're ready to begin, enter text!** The model names will be revealed once you vote.
|
160 |
""".strip()
|
161 |
request = ''
|
162 |
if SPACE_ID:
|
|
|
438 |
return (
|
439 |
text,
|
440 |
"Synthesize",
|
|
|
441 |
gr.update(visible=True), # r2
|
442 |
mdl1, # model1
|
443 |
mdl2, # model2
|
|
|
462 |
with gr.Group():
|
463 |
text = gr.Textbox(label="Enter text to synthesize", info="By entering text, you certify that it is either in the public domain or, if you are its author, you dedicate it into the public domain. You also must agree to the privacy statement in the About page.")
|
464 |
btn = gr.Button("Synthesize", variant='primary')
|
|
|
|
|
|
|
465 |
model1 = gr.Textbox(interactive=False, lines=1, max_lines=1, visible=False)
|
466 |
model2 = gr.Textbox(interactive=False, lines=1, max_lines=1, visible=False)
|
467 |
with gr.Group(visible=False) as r2:
|
468 |
with gr.Row():
|
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")
|
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")
|
479 |
+
outputs = [text, btn, r2, model1, model2, prevmodel1, aud1, prevmodel2, aud2, abetter, bbetter]
|
|
|
|
|
480 |
btn.click(synthandreturn, inputs=[text], outputs=outputs)
|
481 |
|
482 |
nxt_outputs = [prevmodel1, prevmodel2, abetter, bbetter]
|