Update app.py
Browse files
app.py
CHANGED
|
@@ -21,9 +21,20 @@ def predict(input, history=[]):
|
|
| 21 |
|
| 22 |
import gradio as gr
|
| 23 |
|
| 24 |
-
gr.
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
|
|
|
|
| 21 |
|
| 22 |
import gradio as gr
|
| 23 |
|
| 24 |
+
demo = gr.Blocks()
|
| 25 |
+
|
| 26 |
+
with demo:
|
| 27 |
+
with gr.Row():
|
| 28 |
+
output_chatbot = gr.outputs.Chatbot()
|
| 29 |
+
output_state = gr.outputs.State()
|
| 30 |
+
|
| 31 |
+
with gr.Row():
|
| 32 |
+
input_text = gr.inputs.Textbox(label="write some text")
|
| 33 |
+
input_state = gr.inputs.State()
|
| 34 |
+
|
| 35 |
+
submit_button = gr.Button("Send")
|
| 36 |
+
|
| 37 |
+
submit_button.click(predict, inputs=[input_text, input_state], outputs=[output_chatbot, output_state])
|
| 38 |
+
|
| 39 |
+
demo.launch()
|
| 40 |
|