yxmauw commited on
Commit
572bbdb
1 Parent(s): ab5eff5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -17,7 +17,7 @@ def generate_response(model_name, message, chat_history):
17
  input_text = message
18
  response = model.generate(input_text, max_tokens=100)
19
  chat_history.append((input_text, response))
20
- return "", chat_history, response
21
 
22
  # Create Gradio UI
23
  with gr.Blocks() as demo:
@@ -40,9 +40,8 @@ with gr.Blocks() as demo:
40
  chatbot = gr.Chatbot(label="Chatroom", value=[(None, "How may I help you today?")])
41
 
42
  message = gr.Textbox(label="Message")
43
- state = gr.State()
44
 
45
- message.submit(generate_response, inputs=[model_dropdown, message, state], outputs=[message, chatbot, state])
46
 
47
  # Launch the Gradio app
48
  demo.launch()
 
17
  input_text = message
18
  response = model.generate(input_text, max_tokens=100)
19
  chat_history.append((input_text, response))
20
+ return "", chat_history
21
 
22
  # Create Gradio UI
23
  with gr.Blocks() as demo:
 
40
  chatbot = gr.Chatbot(label="Chatroom", value=[(None, "How may I help you today?")])
41
 
42
  message = gr.Textbox(label="Message")
 
43
 
44
+ message.submit(generate_response, inputs=[model_dropdown, message, chatbot], outputs=[message, chatbot])
45
 
46
  # Launch the Gradio app
47
  demo.launch()