Spaces:
Sleeping
Sleeping
Commit ·
4a611ab
1
Parent(s): 4b91c09
update
Browse files
app.py
CHANGED
|
@@ -37,16 +37,28 @@ def models(text, model="Mixtral 8x7B"):
|
|
| 37 |
description = """# H GO
|
| 38 |
### Inspired from Google Go"""
|
| 39 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
demo = gr.Interface(
|
| 41 |
-
description=description,
|
| 42 |
fn=models,
|
| 43 |
-
inputs=[
|
| 44 |
outputs="text",
|
|
|
|
| 45 |
live=True,
|
| 46 |
batch=True,
|
| 47 |
-
max_batch_size=10000
|
|
|
|
| 48 |
)
|
| 49 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
# Queue and launch configuration for Gradio
|
| 51 |
demo.queue(max_size=300000)
|
| 52 |
demo.launch()
|
|
|
|
| 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 |
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")
|
| 61 |
+
|
| 62 |
# Queue and launch configuration for Gradio
|
| 63 |
demo.queue(max_size=300000)
|
| 64 |
demo.launch()
|