Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -75,9 +75,13 @@ def chatbot(query: str) -> str:
|
|
| 75 |
# title=title,
|
| 76 |
# description=description)
|
| 77 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 78 |
# Create a Gradio Blocks interface
|
| 79 |
with gr.Blocks() as demo:
|
| 80 |
-
gr.Markdown(
|
| 81 |
|
| 82 |
with gr.Row():
|
| 83 |
user_input = gr.Textbox(
|
|
@@ -88,14 +92,17 @@ with gr.Blocks() as demo:
|
|
| 88 |
|
| 89 |
with gr.Row():
|
| 90 |
output = gr.Markdown(
|
| 91 |
-
label=chatbot_output_label
|
|
|
|
| 92 |
)
|
| 93 |
|
| 94 |
with gr.Row():
|
| 95 |
-
submit = gr.Button(
|
|
|
|
| 96 |
|
| 97 |
-
# Define button click
|
| 98 |
submit.click(fn=chatbot, inputs=user_input, outputs=output)
|
|
|
|
| 99 |
|
| 100 |
if __name__ == "__main__":
|
| 101 |
demo.launch()
|
|
|
|
| 75 |
# title=title,
|
| 76 |
# description=description)
|
| 77 |
|
| 78 |
+
# Define the reset function
|
| 79 |
+
def reset():
|
| 80 |
+
return ""
|
| 81 |
+
|
| 82 |
# Create a Gradio Blocks interface
|
| 83 |
with gr.Blocks() as demo:
|
| 84 |
+
gr.Markdown(chatbot_title)
|
| 85 |
|
| 86 |
with gr.Row():
|
| 87 |
user_input = gr.Textbox(
|
|
|
|
| 92 |
|
| 93 |
with gr.Row():
|
| 94 |
output = gr.Markdown(
|
| 95 |
+
label=chatbot_output_label,
|
| 96 |
+
value=chatbot_output_placeholder
|
| 97 |
)
|
| 98 |
|
| 99 |
with gr.Row():
|
| 100 |
+
submit = gr.Button(chatbot_submit_button)
|
| 101 |
+
reset = gr.Button(chatbot_reset_button)
|
| 102 |
|
| 103 |
+
# Define button click actions
|
| 104 |
submit.click(fn=chatbot, inputs=user_input, outputs=output)
|
| 105 |
+
reset.click(fn=reset, inputs=None, outputs=output)
|
| 106 |
|
| 107 |
if __name__ == "__main__":
|
| 108 |
demo.launch()
|