vericudebuget commited on
Commit
fb783c6
1 Parent(s): fe66a68

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -12
app.py CHANGED
@@ -47,17 +47,21 @@ additional_inputs = [
47
  ]
48
 
49
  with gr.Blocks(theme=gr.themes.Soft()):
50
- chatbot = gr.Chatbot(show_label=True, show_share_button=False, show_copy_button=True, likeable=True, layout="panel")
51
- with gr.Row():
52
- gr.Chatbot(chatbot)
53
- with gr.Column():
54
- for input_component in additional_inputs:
55
- input_component.render()
56
- gr.Button("Submit").click(generate, inputs=[chatbot.text_input, chatbot.value, additional_inputs[0]], outputs=[chatbot])
57
- app = gr.Interface(
58
- fn=generate,
 
 
 
 
 
59
  title="ConvoLite",
60
- concurrency_limit=20,
61
  theme=gr.themes.Soft(),
62
- )
63
- app.launch(show_api=False)
 
47
  ]
48
 
49
  with gr.Blocks(theme=gr.themes.Soft()):
50
+ chatbot = gr.Chatbot()
51
+ text_input = gr.Textbox(label="Your message")
52
+ submit_btn = gr.Button("Submit")
53
+
54
+ def process_message(message, history):
55
+ history.append((message, generate(message, history, additional_inputs[0].value)))
56
+ return history, ""
57
+
58
+ submit_btn.click(process_message, inputs=[text_input, chatbot], outputs=[chatbot, text_input])
59
+
60
+ gr.Interface(
61
+ fn=None,
62
+ inputs=None,
63
+ outputs=None,
64
  title="ConvoLite",
 
65
  theme=gr.themes.Soft(),
66
+ concurrency_limit=20,
67
+ ).launch(show_api=False)