Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -4,38 +4,11 @@ import gemini_gradio
|
|
4 |
with gr.Blocks(fill_height=True) as demo:
|
5 |
gr.Markdown("**Note:** You need to use a SambaNova API key from [SambaNova Cloud](https://cloud.sambanova.ai/).")
|
6 |
with gr.Tab("Gemini"):
|
7 |
-
with gr.Row():
|
8 |
-
gemini_model = gr.Dropdown(
|
9 |
-
choices=[
|
10 |
-
'gemini-1.5-flash', # Fast and versatile performance
|
11 |
-
'gemini-1.5-flash-8b', # High volume, lower intelligence tasks
|
12 |
-
'gemini-1.5-pro', # Complex reasoning tasks
|
13 |
-
'gemini-exp-1114' # Quality improvements
|
14 |
-
],
|
15 |
-
value='gemini-1.5-pro', # Default to the most advanced model
|
16 |
-
label="Select Gemini Model",
|
17 |
-
interactive=True
|
18 |
-
)
|
19 |
-
|
20 |
gemini_interface = gr.load(
|
21 |
-
name=
|
22 |
src=gemini_gradio.registry,
|
23 |
fill_height=True,
|
24 |
chatbot=gr.Chatbot(height=250, type="messages")
|
25 |
)
|
26 |
-
|
27 |
-
def update_gemini_model(new_model):
|
28 |
-
return gr.load(
|
29 |
-
name=new_model,
|
30 |
-
src=gemini_gradio.registry,
|
31 |
-
fill_height=True,
|
32 |
-
chatbot=gr.Chatbot(type="messages")
|
33 |
-
)
|
34 |
-
|
35 |
-
gemini_model.change(
|
36 |
-
fn=update_gemini_model,
|
37 |
-
inputs=[gemini_model],
|
38 |
-
outputs=[gemini_interface]
|
39 |
-
)
|
40 |
|
41 |
demo.launch(ssr_mode=False)
|
|
|
4 |
with gr.Blocks(fill_height=True) as demo:
|
5 |
gr.Markdown("**Note:** You need to use a SambaNova API key from [SambaNova Cloud](https://cloud.sambanova.ai/).")
|
6 |
with gr.Tab("Gemini"):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
gemini_interface = gr.load(
|
8 |
+
name="gemini-1.5-flash", # Se establece el modelo por defecto
|
9 |
src=gemini_gradio.registry,
|
10 |
fill_height=True,
|
11 |
chatbot=gr.Chatbot(height=250, type="messages")
|
12 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
|
14 |
demo.launch(ssr_mode=False)
|