Spaces:
Sleeping
Sleeping
JCai
commited on
Commit
•
eecd30c
1
Parent(s):
8f7e33c
change UI back to normal chatbot
Browse files
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 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
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 |
-
|
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
|