maulana-m commited on
Commit
42aa415
1 Parent(s): 30dc0cd

add send button

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -36,10 +36,11 @@ def get_answer_chatgpt(chat_history, message, system_message=None):
36
 
37
 
38
  with gr.Blocks() as demo:
39
- system_prompt = gr.Textbox(placeholder="You are helpful assistence", lines=5, label="System")
40
- message = gr.Textbox(placeholder="Please press enter to submit")
41
  chatbot = gr.Chatbot()
 
42
  clear = gr.Button("Clear")
 
43
 
44
  def respond(chat_history, message):
45
  response = get_answer_chatgpt(chat_history, message)
@@ -50,5 +51,6 @@ with gr.Blocks() as demo:
50
  message.submit(respond, [chatbot, message], chatbot)
51
 
52
  clear.click(lambda: None, None, chatbot, queue=False)
 
53
 
54
- demo.launch(share=True)
 
36
 
37
 
38
  with gr.Blocks() as demo:
39
+ system_prompt = gr.Textbox(placeholder="You are helpful assistence", lines=5, label="System Message")
 
40
  chatbot = gr.Chatbot()
41
+ message = gr.Textbox(placeholder="Halo kak, aku mau bertanya", label="Chat Here")
42
  clear = gr.Button("Clear")
43
+ send = gr.Button('Send')
44
 
45
  def respond(chat_history, message):
46
  response = get_answer_chatgpt(chat_history, message)
 
51
  message.submit(respond, [chatbot, message], chatbot)
52
 
53
  clear.click(lambda: None, None, chatbot, queue=False)
54
+ run.click(respond, [chatbot, message], chatbot)
55
 
56
+ demo.launch(debug=True)