Pendrokar commited on
Commit
cc85f78
1 Parent(s): 6ef3a93

keep voting buttons disabled after generate

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -199,7 +199,7 @@ if not os.path.isfile(DB_PATH):
199
 
200
  # Create DB table (if doesn't exist)
201
  create_db_if_missing()
202
-
203
  hf_token = os.getenv('HF_TOKEN')
204
  # Sync local DB with remote repo every 5 minute (only if a change is detected)
205
  scheduler = CommitScheduler(
@@ -860,7 +860,7 @@ with gr.Blocks() as vote:
860
  nxtroundbtn = gr.Button('Next round', visible=False)
861
  # outputs = [text, btn, r2, model1, model2, prevmodel1, aud1, prevmodel2, aud2, abetter, bbetter]
862
  outputs = [text, btn, r2, model1, model2, aud1, aud2, abetter, bbetter, prevmodel1, prevmodel2, nxtroundbtn]
863
- btn.click(disable, outputs=[btn, abetter, bbetter]).then(synthandreturn, inputs=[text], outputs=outputs).then(enable, outputs=[btn, abetter, bbetter])
864
  nxtroundbtn.click(clear_stuff, outputs=outputs)
865
 
866
  # nxt_outputs = [prevmodel1, prevmodel2, abetter, bbetter]
 
199
 
200
  # Create DB table (if doesn't exist)
201
  create_db_if_missing()
202
+
203
  hf_token = os.getenv('HF_TOKEN')
204
  # Sync local DB with remote repo every 5 minute (only if a change is detected)
205
  scheduler = CommitScheduler(
 
860
  nxtroundbtn = gr.Button('Next round', visible=False)
861
  # outputs = [text, btn, r2, model1, model2, prevmodel1, aud1, prevmodel2, aud2, abetter, bbetter]
862
  outputs = [text, btn, r2, model1, model2, aud1, aud2, abetter, bbetter, prevmodel1, prevmodel2, nxtroundbtn]
863
+ btn.click(disable, outputs=[btn, abetter, bbetter]).then(synthandreturn, inputs=[text], outputs=outputs)
864
  nxtroundbtn.click(clear_stuff, outputs=outputs)
865
 
866
  # nxt_outputs = [prevmodel1, prevmodel2, abetter, bbetter]