HarshanaLF commited on
Commit
e44eaba
1 Parent(s): 4a611ab
Files changed (1) hide show
  1. app.py +11 -5
app.py CHANGED
@@ -42,19 +42,25 @@ text_input = gr.Textbox(label="Enter your message here:")
42
  dropdown = gr.Dropdown(['Mixtral 8x7B', 'Nous Hermes Mixtral 8x7B DPO', 'StarChat2 15b', 'Mistral 7B v0.3', 'Phi 3 mini'], value="Mistral 7B v0.3", label="Select Model")
43
  submit_btn = gr.Button("Send")
44
 
 
 
 
45
  demo = gr.Interface(
46
- fn=models,
47
  inputs=[text_input, dropdown],
48
  outputs="text",
49
  description=description,
50
  live=True,
51
  batch=True,
52
- max_batch_size=10000,
53
- layout="vertical"
54
  )
55
 
56
- # Adding the submit button to the interface
57
- demo.add_component(submit_btn)
 
 
 
 
58
 
59
  # Configuring the button to trigger the model response
60
  submit_btn.click(fn=models, inputs=[text_input, dropdown], outputs="text")
 
42
  dropdown = gr.Dropdown(['Mixtral 8x7B', 'Nous Hermes Mixtral 8x7B DPO', 'StarChat2 15b', 'Mistral 7B v0.3', 'Phi 3 mini'], value="Mistral 7B v0.3", label="Select Model")
43
  submit_btn = gr.Button("Send")
44
 
45
+ def chat_interface(text, model):
46
+ return models(text, model)
47
+
48
  demo = gr.Interface(
49
+ fn=chat_interface,
50
  inputs=[text_input, dropdown],
51
  outputs="text",
52
  description=description,
53
  live=True,
54
  batch=True,
55
+ max_batch_size=10000
 
56
  )
57
 
58
+ # Adding the submit button to the interface and configuring it to trigger the model response
59
+ demo = gr.Interface(
60
+ fn=models,
61
+ inputs=[text_input, dropdown],
62
+ outputs="text"
63
+ )
64
 
65
  # Configuring the button to trigger the model response
66
  submit_btn.click(fn=models, inputs=[text_input, dropdown], outputs="text")