Spaces:
Sleeping
Sleeping
eternalBlissard
commited on
Commit
•
a66cb80
1
Parent(s):
5c42fbb
Update app.py
Browse files
app.py
CHANGED
@@ -9,8 +9,12 @@ with gr.Blocks() as demo:
|
|
9 |
val = gr.State(None)
|
10 |
input_text = gr.Textbox(label="Input")
|
11 |
output_text = gr.Textbox(label="Output")
|
|
|
12 |
|
13 |
-
|
14 |
-
|
|
|
|
|
|
|
15 |
|
16 |
demo.launch()
|
|
|
9 |
val = gr.State(None)
|
10 |
input_text = gr.Textbox(label="Input")
|
11 |
output_text = gr.Textbox(label="Output")
|
12 |
+
submit_button = gr.Button("Submit")
|
13 |
|
14 |
+
def on_submit(newVal, previous_val):
|
15 |
+
updated_val = respond(newVal, previous_val)
|
16 |
+
return updated_val, updated_val
|
17 |
+
|
18 |
+
submit_button.click(on_submit, [input_text, val], [val, output_text])
|
19 |
|
20 |
demo.launch()
|