simpx commited on
Commit
0358438
·
1 Parent(s): 6ef37ba

edit style

Browse files
Files changed (1) hide show
  1. app.py +17 -5
app.py CHANGED
@@ -38,11 +38,23 @@ def respond(chat_history, message):
38
  return result
39
 
40
  with gr.Blocks() as demo:
 
 
41
  chatbot = gr.Chatbot()
42
- msg = gr.Textbox()
43
- clear = gr.Button("Clear")
44
-
45
- msg.submit(respond, [chatbot, msg], chatbot)
46
- clear.click(lambda: None, None, chatbot, queue=False)
 
 
 
 
 
 
 
 
 
 
47
 
48
  demo.launch(server_name="0.0.0.0", server_port=8000)
 
38
  return result
39
 
40
  with gr.Blocks() as demo:
41
+ gr.Markdown("## Chat with GPT")
42
+ state = gr.State()
43
  chatbot = gr.Chatbot()
44
+ message = gr.Textbox(label = "Message:", placeholder="Enter text")
45
+ message.submit(
46
+ respond,
47
+ [chatbot, message],
48
+ chatbot,
49
+ )
50
+ with gr.Row():
51
+ clear = gr.Button("Clear")
52
+ clear.click(lambda: None, None, chatbot)
53
+ send = gr.Button("Send")
54
+ send.click(
55
+ respond,
56
+ [chatbot, message],
57
+ chatbot,
58
+ )
59
 
60
  demo.launch(server_name="0.0.0.0", server_port=8000)