akhaliq HF staff commited on
Commit
70fbba8
1 Parent(s): 8a79a3c

update provider label

Browse files
Files changed (2) hide show
  1. app.py +6 -9
  2. utils.py +2 -1
app.py CHANGED
@@ -16,21 +16,19 @@ from app_gemini import demo as demo_gemini
16
  from app_groq import demo as demo_groq
17
  from app_hyperbolic import demo as demo_hyperbolic
18
  from app_fal import demo as demo_fal
19
- #from app_marco_o1 import demo as demo_marco_o1
20
  from app_mistral import demo as demo_mistral
21
  from app_nvidia import demo as demo_nvidia
22
  from app_openai import demo as demo_openai
23
  from app_perplexity import demo as demo_perplexity
24
  from app_qwen import demo as demo_qwen
25
- #from app_sailor import demo as demo_sailor
26
  from app_sambanova import demo as demo_sambanova
27
  from app_together import demo as demo_together
28
  from app_xai import demo as demo_grok
29
  from app_showui import demo as demo_showui
30
  from app_omini import demo as demo_omini
31
 
32
- # Create mapping of models to their demos
33
- DEMOS = {
34
  "Gemini": demo_gemini,
35
  "Grok": demo_grok,
36
  "Cohere": demo_cohere,
@@ -55,15 +53,14 @@ DEMOS = {
55
  "Perplexity": demo_perplexity,
56
  "Experimental": demo_experimental,
57
  "Mistral": demo_mistral,
58
- "NVIDIA": demo_nvidia,
59
- #"Marco-o1": demo_marco_o1,
60
- #"Sailor": demo_sailor,
61
  }
62
 
63
  demo = get_app(
64
- models=list(DEMOS.keys()),
65
  default_model="Gemini",
66
- src=DEMOS,
 
67
  )
68
 
69
  if __name__ == "__main__":
 
16
  from app_groq import demo as demo_groq
17
  from app_hyperbolic import demo as demo_hyperbolic
18
  from app_fal import demo as demo_fal
 
19
  from app_mistral import demo as demo_mistral
20
  from app_nvidia import demo as demo_nvidia
21
  from app_openai import demo as demo_openai
22
  from app_perplexity import demo as demo_perplexity
23
  from app_qwen import demo as demo_qwen
 
24
  from app_sambanova import demo as demo_sambanova
25
  from app_together import demo as demo_together
26
  from app_xai import demo as demo_grok
27
  from app_showui import demo as demo_showui
28
  from app_omini import demo as demo_omini
29
 
30
+ # Create mapping of providers to their demos
31
+ PROVIDERS = {
32
  "Gemini": demo_gemini,
33
  "Grok": demo_grok,
34
  "Cohere": demo_cohere,
 
53
  "Perplexity": demo_perplexity,
54
  "Experimental": demo_experimental,
55
  "Mistral": demo_mistral,
56
+ "NVIDIA": demo_nvidia
 
 
57
  }
58
 
59
  demo = get_app(
60
+ models=list(PROVIDERS.keys()),
61
  default_model="Gemini",
62
+ src=PROVIDERS,
63
+ dropdown_label="Select Provider"
64
  )
65
 
66
  if __name__ == "__main__":
utils.py CHANGED
@@ -8,13 +8,14 @@ def get_app(
8
  default_model: str,
9
  src: Union[Callable[[str, str | None], gr.Blocks], Literal["models"], Dict[str, gr.Blocks]],
10
  accept_token: bool = False,
 
11
  **kwargs,
12
  ) -> gr.Blocks:
13
  def update_model(new_model: str) -> list[gr.Column]:
14
  return [gr.Column(visible=model_name == new_model) for model_name in models]
15
 
16
  with gr.Blocks() as demo:
17
- model = gr.Dropdown(label="Select Model", choices=models, value=default_model)
18
 
19
  columns = []
20
  for model_name in models:
 
8
  default_model: str,
9
  src: Union[Callable[[str, str | None], gr.Blocks], Literal["models"], Dict[str, gr.Blocks]],
10
  accept_token: bool = False,
11
+ dropdown_label: str = "Select Model",
12
  **kwargs,
13
  ) -> gr.Blocks:
14
  def update_model(new_model: str) -> list[gr.Column]:
15
  return [gr.Column(visible=model_name == new_model) for model_name in models]
16
 
17
  with gr.Blocks() as demo:
18
+ model = gr.Dropdown(label=dropdown_label, choices=models, value=default_model)
19
 
20
  columns = []
21
  for model_name in models: