Spaces:
Running
Running
add openai coder
Browse files- app.py +3 -1
- app_openai_coder.py +28 -0
- requirements.txt +1 -1
app.py
CHANGED
@@ -31,10 +31,12 @@ from app_hyperbolic_coder import demo as demo_hyperbolic_coder
|
|
31 |
from app_smolagents import demo as demo_smolagents
|
32 |
from app_groq import demo as demo_groq
|
33 |
from app_groq_coder import demo as demo_groq_coder
|
|
|
34 |
from utils import get_app
|
35 |
|
36 |
# Create mapping of providers to their demos
|
37 |
PROVIDERS = {
|
|
|
38 |
"Gemini Coder": demo_gemini_coder,
|
39 |
"Groq Coder": demo_groq_coder,
|
40 |
"Hyperbolic Coder": demo_hyperbolic_coder,
|
@@ -70,7 +72,7 @@ PROVIDERS = {
|
|
70 |
"NVIDIA": demo_nvidia,
|
71 |
}
|
72 |
|
73 |
-
demo = get_app(models=list(PROVIDERS.keys()), default_model="
|
74 |
|
75 |
if __name__ == "__main__":
|
76 |
demo.queue(api_open=False).launch(show_api=False)
|
|
|
31 |
from app_smolagents import demo as demo_smolagents
|
32 |
from app_groq import demo as demo_groq
|
33 |
from app_groq_coder import demo as demo_groq_coder
|
34 |
+
from app_openai_coder import demo as demo_openai_coder
|
35 |
from utils import get_app
|
36 |
|
37 |
# Create mapping of providers to their demos
|
38 |
PROVIDERS = {
|
39 |
+
"OpenAI Coder": demo_openai_coder,
|
40 |
"Gemini Coder": demo_gemini_coder,
|
41 |
"Groq Coder": demo_groq_coder,
|
42 |
"Hyperbolic Coder": demo_hyperbolic_coder,
|
|
|
72 |
"NVIDIA": demo_nvidia,
|
73 |
}
|
74 |
|
75 |
+
demo = get_app(models=list(PROVIDERS.keys()), default_model="OpenAI Coder", src=PROVIDERS, dropdown_label="Select Provider")
|
76 |
|
77 |
if __name__ == "__main__":
|
78 |
demo.queue(api_open=False).launch(show_api=False)
|
app_openai_coder.py
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import ai_gradio
|
2 |
+
from utils_ai_gradio import get_app
|
3 |
+
|
4 |
+
|
5 |
+
# Get the OpenAI models but keep their full names for loading
|
6 |
+
OPENAI_MODELS_FULL = [
|
7 |
+
k for k in ai_gradio.registry.keys()
|
8 |
+
if k.startswith('openai:')
|
9 |
+
]
|
10 |
+
|
11 |
+
# Create display names without the prefix
|
12 |
+
OPENAI_MODELS_DISPLAY = [
|
13 |
+
k.replace('openai:', '')
|
14 |
+
for k in OPENAI_MODELS_FULL
|
15 |
+
]
|
16 |
+
|
17 |
+
# Create and launch the interface using get_app utility
|
18 |
+
demo = get_app(
|
19 |
+
models=OPENAI_MODELS_FULL, # Use the full names with prefix
|
20 |
+
default_model=OPENAI_MODELS_FULL[5],
|
21 |
+
dropdown_label="Select OpenAI Model",
|
22 |
+
choices=OPENAI_MODELS_DISPLAY, # Display names without prefix
|
23 |
+
fill_height=True,
|
24 |
+
coder=True,
|
25 |
+
)
|
26 |
+
|
27 |
+
if __name__ == "__main__":
|
28 |
+
demo.launch()
|
requirements.txt
CHANGED
@@ -496,4 +496,4 @@ crewai-tools==0.17.0
|
|
496 |
langchain>=0.3.1,<0.4.0
|
497 |
chromadb>=0.5.18
|
498 |
openai==1.58.1
|
499 |
-
ai-gradio[deepseek,crewai,hyperbolic,openai,gemini,smolagents,groq]==0.2.
|
|
|
496 |
langchain>=0.3.1,<0.4.0
|
497 |
chromadb>=0.5.18
|
498 |
openai==1.58.1
|
499 |
+
ai-gradio[deepseek,crewai,hyperbolic,openai,gemini,smolagents,groq]==0.2.7
|