Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -69,9 +69,8 @@ def render_message(history):
|
|
69 |
|
70 |
return messages_html
|
71 |
|
72 |
-
|
73 |
with gr.Blocks() as demo:
|
74 |
-
chatbot_output = gr.HTML()
|
75 |
msg_input = gr.Textbox(show_label=False, placeholder="Type your message here...")
|
76 |
|
77 |
system_message = gr.Textbox(value="You are P-MSQ (Messaging Service Query), a friendly AI Chatbot that can help in any situations.", label="System message")
|
@@ -83,13 +82,14 @@ with gr.Blocks() as demo:
|
|
83 |
def user_interaction(message, history, system_message, max_tokens, top_p, temperature):
|
84 |
history, assistant_reply = respond(message, history, system_message, max_tokens, top_p, temperature)
|
85 |
return render_message(history), history
|
|
|
86 |
msg_input.submit(user_interaction,
|
87 |
inputs=[msg_input, history_state, system_message, max_tokens, top_p, temperature],
|
88 |
outputs=[chatbot_output, history_state])
|
89 |
|
90 |
gr.Markdown("## Chat Interface with Profile Pictures")
|
91 |
-
chatbot_output
|
92 |
-
msg_input
|
93 |
|
94 |
if __name__ == "__main__":
|
95 |
demo.launch()
|
|
|
69 |
|
70 |
return messages_html
|
71 |
|
|
|
72 |
with gr.Blocks() as demo:
|
73 |
+
chatbot_output = gr.HTML()
|
74 |
msg_input = gr.Textbox(show_label=False, placeholder="Type your message here...")
|
75 |
|
76 |
system_message = gr.Textbox(value="You are P-MSQ (Messaging Service Query), a friendly AI Chatbot that can help in any situations.", label="System message")
|
|
|
82 |
def user_interaction(message, history, system_message, max_tokens, top_p, temperature):
|
83 |
history, assistant_reply = respond(message, history, system_message, max_tokens, top_p, temperature)
|
84 |
return render_message(history), history
|
85 |
+
|
86 |
msg_input.submit(user_interaction,
|
87 |
inputs=[msg_input, history_state, system_message, max_tokens, top_p, temperature],
|
88 |
outputs=[chatbot_output, history_state])
|
89 |
|
90 |
gr.Markdown("## Chat Interface with Profile Pictures")
|
91 |
+
chatbot_output
|
92 |
+
msg_input
|
93 |
|
94 |
if __name__ == "__main__":
|
95 |
demo.launch()
|