OuroborosM commited on
Commit
d3f79d4
·
1 Parent(s): f7cd739

new method of chatbot

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -325,12 +325,12 @@ def chathmi2(message, history):
325
  # chatbot = gr.Chatbot().style(color_map =("blue", "pink"))
326
  # chatbot = gr.Chatbot(color_map =("blue", "pink"))
327
 
328
- def func_upload_file(files):
329
  file_path = files
330
  print(file_path)
331
  # UpdateDb()
332
- main.chatbot("Test File Upload")
333
- return("Test Upload")
334
 
335
  with gr.Blocks() as demo:
336
  main = gr.ChatInterface(
@@ -339,7 +339,7 @@ with gr.Blocks() as demo:
339
  description= "v0.3: Powered by MECH Core Team",
340
  )
341
  upload_button = gr.UploadButton("Upload File", file_count="multiple")
342
- upload_button.upload(func_upload_file, upload_button)
343
 
344
  # demo = gr.Interface(
345
  # chathmi,
 
325
  # chatbot = gr.Chatbot().style(color_map =("blue", "pink"))
326
  # chatbot = gr.Chatbot(color_map =("blue", "pink"))
327
 
328
+ def func_upload_file(files, chat_history):
329
  file_path = files
330
  print(file_path)
331
  # UpdateDb()
332
+ chat_history.append("Test File Upload")
333
+ return chat_history
334
 
335
  with gr.Blocks() as demo:
336
  main = gr.ChatInterface(
 
339
  description= "v0.3: Powered by MECH Core Team",
340
  )
341
  upload_button = gr.UploadButton("Upload File", file_count="multiple")
342
+ upload_button.upload(func_upload_file, [upload_button, main.chatbot], main.chatbot)
343
 
344
  # demo = gr.Interface(
345
  # chathmi,