Antoine245 commited on
Commit
adcdc29
·
1 Parent(s): 833323a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -6
app.py CHANGED
@@ -30,18 +30,17 @@ with gr.Blocks() as demo:
30
  msg = gr.Textbox()
31
  clear = gr.ClearButton([msg, chatbot])
32
 
33
- def respond(messages):
34
- global user_input
35
- user_input.append(messages[0]) # Wrap user input in a list
36
  bot_message = palm.chat(
37
  **defaults,
38
  context=context,
39
- examples=examples,
40
  messages=user_input
41
  )
42
  time.sleep(2)
43
- return bot_message['message']
44
 
45
- msg.submit(respond, [msg, chatbot],[msg, chatbot])
46
 
47
  demo.launch()
 
30
  msg = gr.Textbox()
31
  clear = gr.ClearButton([msg, chatbot])
32
 
33
+ def respond(message,chat_history):
34
+ user_input.append([chat_history[0]])
35
+
36
  bot_message = palm.chat(
37
  **defaults,
38
  context=context,
 
39
  messages=user_input
40
  )
41
  time.sleep(2)
42
+ return "", chat_history
43
 
44
+ msg.submit(respond,[msg,chatbot],[msg,chatbot])
45
 
46
  demo.launch()