Antoine245 commited on
Commit
612c776
·
1 Parent(s): 1d67713

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -33,20 +33,20 @@ with gr.Blocks() as demo:
33
 
34
  def user(user_message, history):
35
  return gr.update(value="", interactive=False), history + [[user_message,None]]
36
- def bot(history):
37
  # chat_history.append(message) # Initialize chat history
38
  history[-1][1] = ""
39
  bot_message = palm.chat(
40
  context=context,
41
  examples=examples,
42
- messages=history[0][1]
43
  )
44
  for character in bot_message:
45
  history[-1][1] += character
46
  time.sleep(0.05)
47
  yield history
48
  response = msg.submit(user, [msg, chatbot], [msg, chatbot], queue=False).then(
49
- bot, chatbot, chatbot
50
  )
51
  response.then(lambda: gr.update(interactive=True), None, [msg], queue=False)
52
 
 
33
 
34
  def user(user_message, history):
35
  return gr.update(value="", interactive=False), history + [[user_message,None]]
36
+ def bot(user_message, history):
37
  # chat_history.append(message) # Initialize chat history
38
  history[-1][1] = ""
39
  bot_message = palm.chat(
40
  context=context,
41
  examples=examples,
42
+ messages=user_message
43
  )
44
  for character in bot_message:
45
  history[-1][1] += character
46
  time.sleep(0.05)
47
  yield history
48
  response = msg.submit(user, [msg, chatbot], [msg, chatbot], queue=False).then(
49
+ bot, [msg, chatbot], [msg, chatbot]
50
  )
51
  response.then(lambda: gr.update(interactive=True), None, [msg], queue=False)
52