Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
mrfakename
commited on
Commit
•
b0de8ae
1
Parent(s):
ce4bd8b
Update app.py
Browse files
app.py
CHANGED
@@ -634,9 +634,6 @@ def synthandreturn(text):
|
|
634 |
gr.update(visible=False), #prevmodel1
|
635 |
gr.update(visible=False), #prevmodel2
|
636 |
gr.update(visible=False), #nxt round btn
|
637 |
-
# reset aplayed, bplayed audio playback events
|
638 |
-
#gr.update(value=False), #aplayed
|
639 |
-
#r.update(value=False), #bplayed
|
640 |
)
|
641 |
# return (
|
642 |
# text,
|
@@ -716,8 +713,34 @@ with gr.Blocks() as vote:
|
|
716 |
prevmodel2 = gr.Textbox(interactive=False, show_label=False, container=False, value="Vote to reveal model B", text_align="center", lines=1, max_lines=1, visible=False)
|
717 |
nxtroundbtn = gr.Button('Next round', visible=False)
|
718 |
# outputs = [text, btn, r2, model1, model2, prevmodel1, aud1, prevmodel2, aud2, abetter, bbetter]
|
719 |
-
outputs = [
|
720 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
721 |
nxtroundbtn.click(clear_stuff, outputs=outputs)
|
722 |
|
723 |
# Allow interaction with the vote buttons only when both audio samples have finished playing
|
|
|
634 |
gr.update(visible=False), #prevmodel1
|
635 |
gr.update(visible=False), #prevmodel2
|
636 |
gr.update(visible=False), #nxt round btn
|
|
|
|
|
|
|
637 |
)
|
638 |
# return (
|
639 |
# text,
|
|
|
713 |
prevmodel2 = gr.Textbox(interactive=False, show_label=False, container=False, value="Vote to reveal model B", text_align="center", lines=1, max_lines=1, visible=False)
|
714 |
nxtroundbtn = gr.Button('Next round', visible=False)
|
715 |
# outputs = [text, btn, r2, model1, model2, prevmodel1, aud1, prevmodel2, aud2, abetter, bbetter]
|
716 |
+
outputs = [
|
717 |
+
text,
|
718 |
+
btn,
|
719 |
+
r2,
|
720 |
+
model1,
|
721 |
+
model2,
|
722 |
+
aud1,
|
723 |
+
aud2,
|
724 |
+
abetter,
|
725 |
+
bbetter,
|
726 |
+
prevmodel1,
|
727 |
+
prevmodel2,
|
728 |
+
nxtroundbtn
|
729 |
+
]
|
730 |
+
"""
|
731 |
+
text,
|
732 |
+
"Synthesize",
|
733 |
+
gr.update(visible=True), # r2
|
734 |
+
mdl1, # model1
|
735 |
+
mdl2, # model2
|
736 |
+
gr.update(visible=True, value=results[mdl1]), # aud1
|
737 |
+
gr.update(visible=True, value=results[mdl2]), # aud2
|
738 |
+
gr.update(visible=True, interactive=False), #abetter
|
739 |
+
gr.update(visible=True, interactive=False), #bbetter
|
740 |
+
gr.update(visible=False), #prevmodel1
|
741 |
+
gr.update(visible=False), #prevmodel2
|
742 |
+
gr.update(visible=False), #nxt round btn"""
|
743 |
+
btn.click(disable, outputs=[btn, abetter, bbetter]).then(synthandreturn, inputs=[text], outputs=outputs).then(enable, outputs=[btn, abetter, bbetter])
|
744 |
nxtroundbtn.click(clear_stuff, outputs=outputs)
|
745 |
|
746 |
# Allow interaction with the vote buttons only when both audio samples have finished playing
|