Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
mrfakename
commited on
Commit
•
803001e
1
Parent(s):
b46a5dc
Update app.py
Browse files
app.py
CHANGED
@@ -658,9 +658,9 @@ def randomsent():
|
|
658 |
def clear_stuff():
|
659 |
return "", "Synthesize", gr.update(visible=False), '', '', gr.update(visible=False), gr.update(visible=False), gr.update(visible=False), gr.update(visible=False), gr.update(visible=False), gr.update(visible=False), gr.update(visible=False)
|
660 |
def disable():
|
661 |
-
return gr.update(interactive=False)
|
662 |
def enable():
|
663 |
-
return gr.update(interactive=True)
|
664 |
with gr.Blocks() as vote:
|
665 |
useridstate = gr.State()
|
666 |
gr.Markdown(INSTR)
|
@@ -686,7 +686,7 @@ with gr.Blocks() as vote:
|
|
686 |
nxtroundbtn = gr.Button('Next round', visible=False)
|
687 |
# outputs = [text, btn, r2, model1, model2, prevmodel1, aud1, prevmodel2, aud2, abetter, bbetter]
|
688 |
outputs = [text, btn, r2, model1, model2, aud1, aud2, abetter, bbetter, prevmodel1, prevmodel2, nxtroundbtn]
|
689 |
-
btn.click(disable, outputs=btn).then(synthandreturn, inputs=[text], outputs=outputs).then(enable, outputs=btn)
|
690 |
nxtroundbtn.click(clear_stuff, outputs=outputs)
|
691 |
|
692 |
# nxt_outputs = [prevmodel1, prevmodel2, abetter, bbetter]
|
|
|
658 |
def clear_stuff():
|
659 |
return "", "Synthesize", gr.update(visible=False), '', '', gr.update(visible=False), gr.update(visible=False), gr.update(visible=False), gr.update(visible=False), gr.update(visible=False), gr.update(visible=False), gr.update(visible=False)
|
660 |
def disable():
|
661 |
+
return [gr.update(interactive=False), gr.update(interactive=False), gr.update(interactive=False)]
|
662 |
def enable():
|
663 |
+
return [gr.update(interactive=True), gr.update(interactive=True), gr.update(interactive=True)]
|
664 |
with gr.Blocks() as vote:
|
665 |
useridstate = gr.State()
|
666 |
gr.Markdown(INSTR)
|
|
|
686 |
nxtroundbtn = gr.Button('Next round', visible=False)
|
687 |
# outputs = [text, btn, r2, model1, model2, prevmodel1, aud1, prevmodel2, aud2, abetter, bbetter]
|
688 |
outputs = [text, btn, r2, model1, model2, aud1, aud2, abetter, bbetter, prevmodel1, prevmodel2, nxtroundbtn]
|
689 |
+
btn.click(disable, outputs=[btn, abetter, bbetter]).then(synthandreturn, inputs=[text], outputs=outputs).then(enable, outputs=[btn, abetter, bbetter])
|
690 |
nxtroundbtn.click(clear_stuff, outputs=outputs)
|
691 |
|
692 |
# nxt_outputs = [prevmodel1, prevmodel2, abetter, bbetter]
|