JCai commited on
Commit
eecd30c
1 Parent(s): 8f7e33c

change UI back to normal chatbot

Browse files
Files changed (1) hide show
  1. app.py +11 -20
app.py CHANGED
@@ -197,30 +197,21 @@ with gr.Blocks(css=custom_css) as demo:
197
  use_local_model = gr.Checkbox(label="Use Local Model", value=False)
198
 
199
  with gr.Row():
200
- with gr.Column():
201
- with gr.Tabs() as input_tabs:
202
- with gr.Tab("Sketch"):
203
- input_sketchpad = gr.Sketchpad(type="pil", label="Sketch", layers=False)
204
-
205
- input_text = gr.Textbox(label="input your question")
206
-
207
- with gr.Row():
208
- with gr.Column():
209
- clear_btn = gr.ClearButton(
210
- [input_sketchpad, input_text])
211
- with gr.Column():
212
- submit_btn = gr.Button("Submit", variant="primary")
213
- with gr.Column():
214
- chat_history = gr.Chatbot(label="Chat")
215
-
216
- user_input = gr.Textbox(show_label=False, placeholder="Type your message here...")
217
-
218
- # cancel_button = gr.Button("Cancel Inference", variant="danger")
219
 
220
  # Adjusted to ensure history is maintained and passed correctly
221
  user_input.submit(respond, [user_input, chat_history, use_local_model], chat_history)
222
 
223
- # cancel_button.click(cancel_inference)
224
 
225
  if __name__ == "__main__":
226
  demo.launch(share=False) # Remove share=True because it's not supported on HF Spaces
 
197
  use_local_model = gr.Checkbox(label="Use Local Model", value=False)
198
 
199
  with gr.Row():
200
+ system_message = gr.Textbox(value="You are a cat and you love talking about and teaching math.",
201
+ label="System message",
202
+ interactive=True)
203
+ use_local_model = gr.Checkbox(label="Use Local Model", value=False)
204
+
205
+ chat_history = gr.Chatbot(label="Chat")
206
+
207
+ user_input = gr.Textbox(show_label=False, placeholder="Type your message here...")
208
+
209
+ cancel_button = gr.Button("Cancel Inference", variant="danger")
 
 
 
 
 
 
 
 
 
210
 
211
  # Adjusted to ensure history is maintained and passed correctly
212
  user_input.submit(respond, [user_input, chat_history, use_local_model], chat_history)
213
 
214
+ cancel_button.click(cancel_inference)
215
 
216
  if __name__ == "__main__":
217
  demo.launch(share=False) # Remove share=True because it's not supported on HF Spaces