paralym commited on
Commit
3413cf9
·
verified ·
1 Parent(s): 5c24d0c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -5
app.py CHANGED
@@ -262,7 +262,7 @@ def add_message(history, message):
262
 
263
  print("### Not bigger than one history", history)
264
  print("### Not bigger than one conv", our_chatbot.conversation)
265
- return history, gr.MultimodalTextbox(value=None, interactive=False)
266
  else:
267
  for x in message["files"]:
268
  history.append(((x,), None))
@@ -271,7 +271,7 @@ def add_message(history, message):
271
 
272
  print("### Bigger than one history", history)
273
  print("### Bigger than one conv", our_chatbot.conversation)
274
- return history, gr.MultimodalTextbox(value=None, interactive=False)
275
 
276
 
277
  @spaces.GPU
@@ -549,10 +549,13 @@ with gr.Blocks(
549
  gr.Markdown(bibtext)
550
 
551
  # chat_msg =
 
 
 
552
  chat_input.submit(
553
- add_message, [chatbot, chat_input], [chatbot, chat_input]
554
- ).then(bot, [chatbot,temperature, top_p, max_output_tokens], chatbot, api_name="bot_response").then(lambda: gr.MultimodalTextbox(interactive=True), None, [chat_input])
555
-
556
  # chatbot.like(print_like_dislike, None, None)
557
  clear_btn.click(
558
  fn=clear_history, inputs=[chatbot], outputs=[chatbot], api_name="clear_all"
 
262
 
263
  print("### Not bigger than one history", history)
264
  print("### Not bigger than one conv", our_chatbot.conversation)
265
+ return history, gr.MultimodalTextbox(value=None, interactive=False), our_chatbot
266
  else:
267
  for x in message["files"]:
268
  history.append(((x,), None))
 
271
 
272
  print("### Bigger than one history", history)
273
  print("### Bigger than one conv", our_chatbot.conversation)
274
+ return history, gr.MultimodalTextbox(value=None, interactive=False), our_chatbot
275
 
276
 
277
  @spaces.GPU
 
549
  gr.Markdown(bibtext)
550
 
551
  # chat_msg =
552
+ # chat_input.submit(
553
+ # add_message, [chatbot, chat_input], [chatbot, chat_input]
554
+ # ).then(bot, [chatbot,temperature, top_p, max_output_tokens], chatbot, api_name="bot_response").then(lambda: gr.MultimodalTextbox(interactive=True), None, [chat_input])
555
  chat_input.submit(
556
+ add_message, [chatbot, chat_input], [chatbot, chat_input, 'state']
557
+ ).then(bot, ['state', chatbot, temperature, top_p, max_output_tokens], chatbot).then(lambda: gr.MultimodalTextbox(interactive=True), None, [chat_input])
558
+
559
  # chatbot.like(print_like_dislike, None, None)
560
  clear_btn.click(
561
  fn=clear_history, inputs=[chatbot], outputs=[chatbot], api_name="clear_all"