Adam Jirkovsky commited on
Commit
e7bf219
·
1 Parent(s): 83a0ab6

Captcha test

Browse files
Files changed (1) hide show
  1. app.py +5 -0
app.py CHANGED
@@ -345,6 +345,11 @@ with demo:
345
  show_share_button=False,
346
  )
347
  captcha_input = gr.Textbox(placeholder="Enter the text in the image above", show_label=False, container=False)
 
 
 
 
 
348
  submit_button = gr.Button("Submit Eval", interactive=True)
349
  submission_result = gr.Markdown()
350
  submit_button.click(
 
345
  show_share_button=False,
346
  )
347
  captcha_input = gr.Textbox(placeholder="Enter the text in the image above", show_label=False, container=False)
348
+ check_button = gr.Button("Check", interactive=True)
349
+ check_button.click(
350
+ fn = lambda: gr.alert("Correct!" if captcha_input.value == text else "Incorrect!"),
351
+ inputs = [captcha_input],
352
+ )
353
  submit_button = gr.Button("Submit Eval", interactive=True)
354
  submission_result = gr.Markdown()
355
  submit_button.click(