Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
mrfakename
commited on
Commit
β’
6b71cc7
1
Parent(s):
85e1ca3
revert
Browse files
app.py
CHANGED
@@ -583,8 +583,6 @@ def synthandreturn(text):
|
|
583 |
# gr.update(visible=False),
|
584 |
# gr.update(visible=False), #nxt round btn
|
585 |
# )
|
586 |
-
def randsynthandreturn():
|
587 |
-
return synthandreturn(random.choice(sents))
|
588 |
def randomsent():
|
589 |
return random.choice(sents), 'π²'
|
590 |
def clear_stuff():
|
@@ -611,17 +609,14 @@ with gr.Blocks() as vote:
|
|
611 |
aud2 = gr.Audio(interactive=False, show_label=False, show_download_button=False, show_share_button=False, waveform_options={'waveform_progress_color': '#3C82F6'})
|
612 |
bbetter = gr.Button("B is better", variant='primary')
|
613 |
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)
|
614 |
-
|
615 |
-
nxtroundbtn = gr.Button('Next round', scale=100)
|
616 |
-
randomnext = gr.Button('π²β‘οΈ', scale=0, min_width=0)
|
617 |
# outputs = [text, btn, r2, model1, model2, prevmodel1, aud1, prevmodel2, aud2, abetter, bbetter]
|
618 |
-
outputs = [text, btn, r2, model1, model2, aud1, aud2, abetter, bbetter, prevmodel1, prevmodel2,
|
619 |
btn.click(synthandreturn, inputs=[text], outputs=outputs)
|
620 |
-
randomnext.click(randsynthandreturn, outputs=outputs)
|
621 |
nxtroundbtn.click(clear_stuff, outputs=outputs)
|
622 |
|
623 |
# nxt_outputs = [prevmodel1, prevmodel2, abetter, bbetter]
|
624 |
-
nxt_outputs = [abetter, bbetter, prevmodel1, prevmodel2,
|
625 |
abetter.click(a_is_better, outputs=nxt_outputs, inputs=[model1, model2, useridstate])
|
626 |
bbetter.click(b_is_better, outputs=nxt_outputs, inputs=[model1, model2, useridstate])
|
627 |
# skipbtn.click(b_is_better, outputs=outputs, inputs=[model1, model2, useridstate])
|
|
|
583 |
# gr.update(visible=False),
|
584 |
# gr.update(visible=False), #nxt round btn
|
585 |
# )
|
|
|
|
|
586 |
def randomsent():
|
587 |
return random.choice(sents), 'π²'
|
588 |
def clear_stuff():
|
|
|
609 |
aud2 = gr.Audio(interactive=False, show_label=False, show_download_button=False, show_share_button=False, waveform_options={'waveform_progress_color': '#3C82F6'})
|
610 |
bbetter = gr.Button("B is better", variant='primary')
|
611 |
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)
|
612 |
+
nxtroundbtn = gr.Button('Next round', visible=False)
|
|
|
|
|
613 |
# outputs = [text, btn, r2, model1, model2, prevmodel1, aud1, prevmodel2, aud2, abetter, bbetter]
|
614 |
+
outputs = [text, btn, r2, model1, model2, aud1, aud2, abetter, bbetter, prevmodel1, prevmodel2, nxtroundbtn]
|
615 |
btn.click(synthandreturn, inputs=[text], outputs=outputs)
|
|
|
616 |
nxtroundbtn.click(clear_stuff, outputs=outputs)
|
617 |
|
618 |
# nxt_outputs = [prevmodel1, prevmodel2, abetter, bbetter]
|
619 |
+
nxt_outputs = [abetter, bbetter, prevmodel1, prevmodel2, nxtroundbtn]
|
620 |
abetter.click(a_is_better, outputs=nxt_outputs, inputs=[model1, model2, useridstate])
|
621 |
bbetter.click(b_is_better, outputs=nxt_outputs, inputs=[model1, model2, useridstate])
|
622 |
# skipbtn.click(b_is_better, outputs=outputs, inputs=[model1, model2, useridstate])
|