Trigger82 commited on
Commit
91de079
·
verified ·
1 Parent(s): 57b43da

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -42,15 +42,15 @@ def chat(user_input, history):
42
  response = enhance_response(response, user_input)
43
 
44
  history.append((user_input, response))
45
- return history, history
46
 
47
  with gr.Blocks() as demo:
48
  gr.Markdown("# 𝕴 𝖆𝖒 𝖍𝖎𝖒\n*Smooth • Chill • Emotional*")
49
- chatbot = gr.Chatbot(height=400, type="messages", label="Chat") # <-- specify type and height here
50
  msg = gr.Textbox(placeholder="Type something…", show_label=False)
51
  state = gr.State([])
52
 
53
  msg.submit(chat, [msg, state], [chatbot, state])
54
- gr.Button("Reset").click(lambda: ([], []), None, [chatbot, state])
55
 
56
- demo.launch()
 
42
  response = enhance_response(response, user_input)
43
 
44
  history.append((user_input, response))
45
+ return history # Return just the updated chat history
46
 
47
  with gr.Blocks() as demo:
48
  gr.Markdown("# 𝕴 𝖆𝖒 𝖍𝖎𝖒\n*Smooth • Chill • Emotional*")
49
+ chatbot = gr.Chatbot(height=400, type="messages", label="Chat")
50
  msg = gr.Textbox(placeholder="Type something…", show_label=False)
51
  state = gr.State([])
52
 
53
  msg.submit(chat, [msg, state], [chatbot, state])
54
+ gr.Button("Reset").click(lambda: [], None, [chatbot, state])
55
 
56
+ demo.launch(server_name="0.0.0.0", server_port=7860, enable_api=True)