AashitaK commited on
Commit
1d5da2c
·
verified ·
1 Parent(s): 76dff7b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -22
app.py CHANGED
@@ -75,14 +75,14 @@ class ChatbotInterface:
75
  # Chatbot history component
76
  chatbot_output = gr.Chatbot(label=self.output_label)
77
 
78
- # # User input
79
- # user_input = gr.Textbox(
80
- # lines=2,
81
- # label=self.input_label,
82
- # placeholder=self.input_placeholder
83
- # )
84
 
85
-
86
  # # Buttons
87
  # with gr.Row():
88
  # reset = gr.Button(self.reset_button, variant="secondary")
@@ -93,21 +93,6 @@ class ChatbotInterface:
93
  # user_input.submit(fn=conversation, inputs=[user_input, chatbot_output], outputs=chatbot_output)
94
  # reset.click(fn=self.reset_output, inputs=None, outputs=chatbot_output)
95
 
96
- # User input with send button
97
- with gr.Row():
98
- user_input = gr.Textbox(
99
- lines=2,
100
- label=self.input_label,
101
- placeholder=self.input_placeholder
102
- )
103
- send_button = gr.Button("➤", size="sm") # Small send button like ChatGPT
104
-
105
- # Enable Enter key submission
106
- user_input.submit(fn=conversation, inputs=[user_input, chatbot_output], outputs=chatbot_output)
107
-
108
- # Enable send button click submission
109
- send_button.click(fn=conversation, inputs=[user_input, chatbot_output], outputs=chatbot_output)
110
-
111
  logging.info("Gradio interface created successfully.")
112
  return demo
113
 
 
75
  # Chatbot history component
76
  chatbot_output = gr.Chatbot(label=self.output_label)
77
 
78
+ # User input
79
+ user_input = gr.Textbox(
80
+ lines=2,
81
+ label=self.input_label,
82
+ placeholder=self.input_placeholder
83
+ )
84
 
85
+ user_input.submit(fn=conversation, inputs=[user_input, chatbot_output], outputs=chatbot_output)
86
  # # Buttons
87
  # with gr.Row():
88
  # reset = gr.Button(self.reset_button, variant="secondary")
 
93
  # user_input.submit(fn=conversation, inputs=[user_input, chatbot_output], outputs=chatbot_output)
94
  # reset.click(fn=self.reset_output, inputs=None, outputs=chatbot_output)
95
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
96
  logging.info("Gradio interface created successfully.")
97
  return demo
98