research14 commited on
Commit
5425a6b
·
1 Parent(s): a7472ee
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -67,19 +67,22 @@ with gr.Blocks() as demo:
67
  return response
68
 
69
  # Define the Gradio interface
70
- def chatbot_interface_POS(prompt_POS):
 
71
  vicuna_response_POS = generate_response(prompt_POS)
72
  # Add responses from other chatbots if needed
73
  return {"Vicuna-7B": vicuna_response_POS}
74
 
75
- def chatbot_interface_Chunk(prompt_chunk):
 
76
  vicuna_response_chunk = generate_response(prompt_chunk)
77
  # Add responses from other chatbots if needed
78
  return {"Vicuna-7B": vicuna_response_chunk}
79
 
80
  # Connect the interfaces to the functions
81
- send_button_POS.click(chatbot_interface_POS, [prompt_POS, vicuna_chatbot1_POS])
82
- send_button_Chunk.click(chatbot_interface_Chunk, [prompt_chunk, vicuna_chatbot1_chunk])
 
83
 
84
 
85
  demo.launch()
 
67
  return response
68
 
69
  # Define the Gradio interface
70
+ def chatbot_interface_POS(input_dict):
71
+ prompt_POS = input_dict["prompt_POS"]
72
  vicuna_response_POS = generate_response(prompt_POS)
73
  # Add responses from other chatbots if needed
74
  return {"Vicuna-7B": vicuna_response_POS}
75
 
76
+ def chatbot_interface_Chunk(input_dict):
77
+ prompt_chunk = input_dict["prompt_chunk"]
78
  vicuna_response_chunk = generate_response(prompt_chunk)
79
  # Add responses from other chatbots if needed
80
  return {"Vicuna-7B": vicuna_response_chunk}
81
 
82
  # Connect the interfaces to the functions
83
+ send_button_POS.click(chatbot_interface_POS, {"prompt_POS": prompt_POS, "vicuna_chatbot1_POS": vicuna_chatbot1_POS})
84
+ send_button_Chunk.click(chatbot_interface_Chunk, {"prompt_chunk": prompt_chunk, "vicuna_chatbot1_chunk": vicuna_chatbot1_chunk})
85
+
86
 
87
 
88
  demo.launch()