akhaliq HF staff commited on
Commit
232e96a
·
1 Parent(s): 51f2afc

add groq coder

Browse files
Files changed (3) hide show
  1. app.py +3 -1
  2. app_groq.py +20 -18
  3. app_groq_coder.py +28 -0
app.py CHANGED
@@ -5,7 +5,6 @@ from app_cohere import demo as demo_cohere
5
  from app_experimental import demo as demo_experimental
6
  from app_fal import demo as demo_fal
7
  from app_fireworks import demo as demo_fireworks
8
- from app_groq import demo as demo_groq
9
  from app_huggingface import demo as demo_huggingface
10
  from app_meta import demo as demo_meta
11
  from app_mistral import demo as demo_mistral
@@ -30,12 +29,15 @@ from app_gemini import demo as demo_gemini
30
  from app_gemini_voice import demo as demo_gemini_voice
31
  from app_hyperbolic_coder import demo as demo_hyperbolic_coder
32
  from app_smolagents import demo as demo_smolagents
 
 
33
  from utils import get_app
34
 
35
  # Create mapping of providers to their demos
36
  PROVIDERS = {
37
  "Gemini Coder": demo_gemini_coder,
38
  "Hyperbolic Coder": demo_hyperbolic_coder,
 
39
  "SmolAgents": demo_smolagents,
40
  "DeepSeek": demo_deepseek,
41
  "OpenAI": demo_openai,
 
5
  from app_experimental import demo as demo_experimental
6
  from app_fal import demo as demo_fal
7
  from app_fireworks import demo as demo_fireworks
 
8
  from app_huggingface import demo as demo_huggingface
9
  from app_meta import demo as demo_meta
10
  from app_mistral import demo as demo_mistral
 
29
  from app_gemini_voice import demo as demo_gemini_voice
30
  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
  "Hyperbolic Coder": demo_hyperbolic_coder,
40
+ "Groq Coder": demo_groq_coder,
41
  "SmolAgents": demo_smolagents,
42
  "DeepSeek": demo_deepseek,
43
  "OpenAI": demo_openai,
app_groq.py CHANGED
@@ -1,26 +1,28 @@
1
  import os
2
 
3
- import groq_gradio
4
 
5
- from utils import get_app
 
 
 
 
 
 
 
 
 
 
 
 
6
 
7
  demo = get_app(
8
- models=[
9
- "llama3-groq-8b-8192-tool-use-preview",
10
- "llama3-groq-70b-8192-tool-use-preview",
11
- "llama-3.2-1b-preview",
12
- "llama-3.2-3b-preview",
13
- "llama-3.2-11b-vision-preview",
14
- "llama-3.2-90b-vision-preview",
15
- "mixtral-8x7b-32768",
16
- "gemma2-9b-it",
17
- "gemma-7b-it",
18
- "llama-3.3-70b-versatile",
19
- "llama-3.3-70b-specdec",
20
- ],
21
- default_model="llama-3.3-70b-specdec",
22
- src=groq_gradio.registry,
23
- accept_token=not os.getenv("GROQ_API_KEY"),
24
  )
25
 
26
  if __name__ == "__main__":
 
1
  import os
2
 
3
+ import ai_gradio
4
 
5
+ from utils_ai_gradio import get_app
6
+
7
+ # Get the Groq models from the registry
8
+ GROQ_MODELS_FULL = [
9
+ k for k in ai_gradio.registry.keys()
10
+ if k.startswith('groq:')
11
+ ]
12
+
13
+ # Create display names without the prefix
14
+ GROQ_MODELS_DISPLAY = [
15
+ k.replace('groq:', '')
16
+ for k in GROQ_MODELS_FULL
17
+ ]
18
 
19
  demo = get_app(
20
+ models=GROQ_MODELS_FULL,
21
+ default_model=GROQ_MODELS_FULL[-2],
22
+ src=ai_gradio.registry,
23
+ dropdown_label="Select Groq Model",
24
+ choices=GROQ_MODELS_DISPLAY,
25
+ fill_height=True
 
 
 
 
 
 
 
 
 
 
26
  )
27
 
28
  if __name__ == "__main__":
app_groq_coder.py ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import ai_gradio
2
+ from utils_ai_gradio import get_app
3
+
4
+ # Get the Groq models but keep their full names for loading
5
+ GROQ_MODELS_FULL = [
6
+ k for k in ai_gradio.registry.keys()
7
+ if k.startswith('groq:')
8
+ ]
9
+
10
+ # Create display names without the prefix
11
+ GROQ_MODELS_DISPLAY = [
12
+ k.replace('groq:', '')
13
+ for k in GROQ_MODELS_FULL
14
+ ]
15
+
16
+ # Create and launch the interface using get_app utility
17
+ demo = get_app(
18
+ models=GROQ_MODELS_FULL, # Use the full names with prefix
19
+ default_model=GROQ_MODELS_FULL[-2],
20
+ dropdown_label="Select Groq Model",
21
+ choices=GROQ_MODELS_DISPLAY, # Display names without prefix
22
+ fill_height=True,
23
+ coder=True
24
+ )
25
+
26
+
27
+ if __name__ == "__main__":
28
+ demo.launch()