HarshanaLF commited on
Commit
8c7374c
1 Parent(s): e44eaba
Files changed (1) hide show
  1. app.py +9 -27
app.py CHANGED
@@ -37,33 +37,15 @@ def models(text, model="Mixtral 8x7B"):
37
  description = """# H GO
38
  ### Inspired from Google Go"""
39
 
40
- # Creating the Gradio interface
41
- 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
- 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")
67
 
68
  # Queue and launch configuration for Gradio
69
  demo.queue(max_size=300000)
 
37
  description = """# H GO
38
  ### Inspired from Google Go"""
39
 
40
+ with gr.Blocks() as demo:
41
+ gr.Markdown(description)
42
+
43
+ text_input = gr.Textbox(label="Enter your message here:")
44
+ 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")
45
+ submit_btn = gr.Button("Send")
46
+ output_text = gr.Textbox(label="Response")
47
+
48
+ submit_btn.click(fn=models, inputs=[text_input, dropdown], outputs=output_text)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
49
 
50
  # Queue and launch configuration for Gradio
51
  demo.queue(max_size=300000)