Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
import gradio as gr
|
|
|
2 |
import openai_gradio
|
3 |
import anthropic_gradio
|
4 |
import sambanova_gradio
|
@@ -7,8 +8,6 @@ import hyperbolic_gradio
|
|
7 |
import perplexity_gradio
|
8 |
import mistral_gradio
|
9 |
import fireworks_gradio
|
10 |
-
import os
|
11 |
-
import google.generativeai as genai # Importar la librería de Google Gemini para interactuar con la API
|
12 |
|
13 |
|
14 |
|
@@ -52,12 +51,8 @@ with gr.Blocks(fill_height=True) as demo:
|
|
52 |
inputs=[llama_model],
|
53 |
outputs=[llama_interface]
|
54 |
)
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
with gr.Blocks() as demo:
|
59 |
-
gr.Markdown("**Note:** You need to use a Google Gemini API key from your account.")
|
60 |
-
|
61 |
with gr.Tab("Gemini"):
|
62 |
with gr.Row():
|
63 |
gemini_model = gr.Dropdown(
|
@@ -74,6 +69,7 @@ with gr.Blocks() as demo:
|
|
74 |
|
75 |
gemini_interface = gr.load(
|
76 |
name=gemini_model.value,
|
|
|
77 |
fill_height=True,
|
78 |
chatbot=gr.Chatbot(height=600)
|
79 |
)
|
@@ -81,6 +77,7 @@ with gr.Blocks() as demo:
|
|
81 |
def update_gemini_model(new_model):
|
82 |
return gr.load(
|
83 |
name=new_model,
|
|
|
84 |
fill_height=True,
|
85 |
chatbot=gr.Chatbot(height=600)
|
86 |
)
|
@@ -380,5 +377,3 @@ with gr.Blocks() as demo:
|
|
380 |
""")
|
381 |
|
382 |
demo.launch(ssr_mode=False)
|
383 |
-
|
384 |
-
|
|
|
1 |
import gradio as gr
|
2 |
+
import gemini_gradio
|
3 |
import openai_gradio
|
4 |
import anthropic_gradio
|
5 |
import sambanova_gradio
|
|
|
8 |
import perplexity_gradio
|
9 |
import mistral_gradio
|
10 |
import fireworks_gradio
|
|
|
|
|
11 |
|
12 |
|
13 |
|
|
|
51 |
inputs=[llama_model],
|
52 |
outputs=[llama_interface]
|
53 |
)
|
54 |
+
|
55 |
+
gr.Markdown("**Note:** You need to use a SambaNova API key from [SambaNova Cloud](https://cloud.sambanova.ai/).")
|
|
|
|
|
|
|
|
|
56 |
with gr.Tab("Gemini"):
|
57 |
with gr.Row():
|
58 |
gemini_model = gr.Dropdown(
|
|
|
69 |
|
70 |
gemini_interface = gr.load(
|
71 |
name=gemini_model.value,
|
72 |
+
src=gemini_gradio.registry,
|
73 |
fill_height=True,
|
74 |
chatbot=gr.Chatbot(height=600)
|
75 |
)
|
|
|
77 |
def update_gemini_model(new_model):
|
78 |
return gr.load(
|
79 |
name=new_model,
|
80 |
+
src=gemini_gradio.registry,
|
81 |
fill_height=True,
|
82 |
chatbot=gr.Chatbot(height=600)
|
83 |
)
|
|
|
377 |
""")
|
378 |
|
379 |
demo.launch(ssr_mode=False)
|
|
|
|