AashitaK commited on
Commit
7e89408
·
verified ·
1 Parent(s): be166c7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -4
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("# AI Chatbot Interface")
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("Submit")
 
96
 
97
- # Define button click action
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()