Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
add back gemini
Browse files
app.py
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
from app_huggingface import demo as demo_huggingface
|
|
|
2 |
from utils import get_app
|
3 |
import gradio as gr
|
4 |
|
@@ -13,12 +14,19 @@ gr.load(
|
|
13 |
coder=True,
|
14 |
provider="together"
|
15 |
).launch()""",
|
16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
}
|
18 |
-
|
19 |
# Create mapping of providers to their demos
|
20 |
PROVIDERS = {
|
21 |
"Hugging Face": demo_huggingface,
|
|
|
22 |
}
|
23 |
|
24 |
# Modified get_app implementation
|
@@ -28,13 +36,13 @@ with demo:
|
|
28 |
|
29 |
provider_dropdown = gr.Dropdown(
|
30 |
choices=list(PROVIDERS.keys()),
|
31 |
-
value="
|
32 |
label="Select code snippet"
|
33 |
)
|
34 |
code_display = gr.Code(
|
35 |
label="Provider Code Snippet",
|
36 |
language="python",
|
37 |
-
value=PROVIDER_SNIPPETS["
|
38 |
)
|
39 |
|
40 |
def update_code(provider):
|
@@ -49,7 +57,7 @@ with demo:
|
|
49 |
|
50 |
selected_demo = get_app(
|
51 |
models=list(PROVIDERS.keys()),
|
52 |
-
default_model="
|
53 |
src=PROVIDERS,
|
54 |
dropdown_label="Select Provider",
|
55 |
)
|
|
|
1 |
from app_huggingface import demo as demo_huggingface
|
2 |
+
from app_gemini_coder import demo as demo_gemini_coder
|
3 |
from utils import get_app
|
4 |
import gradio as gr
|
5 |
|
|
|
14 |
coder=True,
|
15 |
provider="together"
|
16 |
).launch()""",
|
17 |
+
"Gemini Coder": """
|
18 |
+
import gradio as gr
|
19 |
+
import ai_gradio
|
20 |
+
gr.load(
|
21 |
+
name='gemini:gemini-1.5-pro',
|
22 |
+
src=ai_gradio.registry,
|
23 |
+
coder=True,
|
24 |
+
).launch()""",
|
25 |
}
|
|
|
26 |
# Create mapping of providers to their demos
|
27 |
PROVIDERS = {
|
28 |
"Hugging Face": demo_huggingface,
|
29 |
+
"Gemini Coder": demo_gemini_coder,
|
30 |
}
|
31 |
|
32 |
# Modified get_app implementation
|
|
|
36 |
|
37 |
provider_dropdown = gr.Dropdown(
|
38 |
choices=list(PROVIDERS.keys()),
|
39 |
+
value="Gemini Coder",
|
40 |
label="Select code snippet"
|
41 |
)
|
42 |
code_display = gr.Code(
|
43 |
label="Provider Code Snippet",
|
44 |
language="python",
|
45 |
+
value=PROVIDER_SNIPPETS["Gemini Coder"]
|
46 |
)
|
47 |
|
48 |
def update_code(provider):
|
|
|
57 |
|
58 |
selected_demo = get_app(
|
59 |
models=list(PROVIDERS.keys()),
|
60 |
+
default_model="Gemini Coder",
|
61 |
src=PROVIDERS,
|
62 |
dropdown_label="Select Provider",
|
63 |
)
|