Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -68,11 +68,11 @@ def chatbot(query: str) -> str:
|
|
| 68 |
|
| 69 |
# Define the reset function
|
| 70 |
def reset_output():
|
| 71 |
-
return
|
| 72 |
|
| 73 |
# Create a Gradio Blocks interface
|
| 74 |
with gr.Blocks() as demo:
|
| 75 |
-
gr.Markdown(chatbot_title)
|
| 76 |
|
| 77 |
with gr.Row():
|
| 78 |
user_input = gr.Textbox(
|
|
@@ -82,6 +82,7 @@ with gr.Blocks() as demo:
|
|
| 82 |
)
|
| 83 |
|
| 84 |
with gr.Row():
|
|
|
|
| 85 |
output = gr.Markdown(
|
| 86 |
label=chatbot_output_label,
|
| 87 |
value=chatbot_output_placeholder
|
|
@@ -94,6 +95,6 @@ with gr.Blocks() as demo:
|
|
| 94 |
# Define button click actions
|
| 95 |
submit.click(fn=chatbot, inputs=user_input, outputs=output)
|
| 96 |
reset.click(fn=reset_output, inputs=None, outputs=output)
|
| 97 |
-
|
| 98 |
if __name__ == "__main__":
|
| 99 |
demo.launch()
|
|
|
|
| 68 |
|
| 69 |
# Define the reset function
|
| 70 |
def reset_output():
|
| 71 |
+
return chatbot_output_placeholder
|
| 72 |
|
| 73 |
# Create a Gradio Blocks interface
|
| 74 |
with gr.Blocks() as demo:
|
| 75 |
+
gr.Markdown(f"## {chatbot_title}\n{chatbot_description}")
|
| 76 |
|
| 77 |
with gr.Row():
|
| 78 |
user_input = gr.Textbox(
|
|
|
|
| 82 |
)
|
| 83 |
|
| 84 |
with gr.Row():
|
| 85 |
+
# Output box always visible with initial placeholder
|
| 86 |
output = gr.Markdown(
|
| 87 |
label=chatbot_output_label,
|
| 88 |
value=chatbot_output_placeholder
|
|
|
|
| 95 |
# Define button click actions
|
| 96 |
submit.click(fn=chatbot, inputs=user_input, outputs=output)
|
| 97 |
reset.click(fn=reset_output, inputs=None, outputs=output)
|
| 98 |
+
|
| 99 |
if __name__ == "__main__":
|
| 100 |
demo.launch()
|