Spaces:
Runtime error
Runtime error
Benjamin Bossan
commited on
Commit
·
4e71b4d
1
Parent(s):
71965fb
Clear text field after submission
Browse files
demo.py
CHANGED
|
@@ -78,6 +78,10 @@ def get_demo():
|
|
| 78 |
inputs = gr.Textbox(lines=3, label="Input")
|
| 79 |
btn_submit = gr.Button("Submit")
|
| 80 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 81 |
# check job status
|
| 82 |
gr.Markdown(
|
| 83 |
"Processing can take a couple of minutes, the info box below gives an "
|
|
|
|
| 78 |
inputs = gr.Textbox(lines=3, label="Input")
|
| 79 |
btn_submit = gr.Button("Submit")
|
| 80 |
|
| 81 |
+
# clear text box
|
| 82 |
+
btn_submit.click(lambda x: gr.update(value=''), [], [inputs])
|
| 83 |
+
inputs.submit(lambda x: gr.update(value=''), [], [inputs])
|
| 84 |
+
|
| 85 |
# check job status
|
| 86 |
gr.Markdown(
|
| 87 |
"Processing can take a couple of minutes, the info box below gives an "
|