add hyperbolic deepseek
Browse filesFiles changed (4)
- app.py+1-1
- app_hyperbolic.py+19-21
- requirements.txt+1-1
- utils_hyperbolic.pyAdded+44
35 unmodified lines363738394041424344454546474835 unmodified lines "Gemini": demo_gemini, "OpenAI Voice": demo_openai_voice, "Gemini Voice": demo_gemini_voice, "Hyperbolic": demo_hyperbolic, "CrewAI": demo_crew, "LumaAI": demo_lumaai, "ChatGPT": demo_openai, "Grok": demo_grok, "Cohere": demo_cohere, "SambaNova": demo_sambanova, "Hyperbolic": demo_hyperbolic, "OminiControl": demo_omini, "Fireworks": demo_fireworks, "Together": demo_together,112334567895101112131415161718891011121314151617181920212223192021222324252627import osimport ai_gradiofrom utils_hyperbolic import get_app
import hyperbolic_gradio# Get the hyperbolic models but keep their full names for loadingHYPERBOLIC_MODELS_FULL = [ k for k in ai_gradio.registry.keys() if k.startswith('hyperbolic:')]
from utils import get_app# Create display names without the prefixHYPERBOLIC_MODELS_DISPLAY = [ k.replace('hyperbolic:', '') for k in HYPERBOLIC_MODELS_FULL]
# Create and launch the interface using get_app utilitydemo = get_app( models=[ "Qwen/Qwen2.5-Coder-32B-Instruct", "meta-llama/Llama-3.2-3B-Instruct", "meta-llama/Meta-Llama-3.1-8B-Instruct", "meta-llama/Meta-Llama-3.1-70B-Instruct", "meta-llama/Meta-Llama-3-70B-Instruct", "NousResearch/Hermes-3-Llama-3.1-70B", "Qwen/Qwen2.5-72B-Instruct", "deepseek-ai/DeepSeek-V2.5", "meta-llama/Meta-Llama-3.1-405B-Instruct", "Qwen/QwQ-32B-Preview", "meta-llama/Llama-3.3-70B-Instruct", ], default_model="meta-llama/Llama-3.3-70B-Instruct", src=hyperbolic_gradio.registry, accept_token=not os.getenv("HYPERBOLIC_API_KEY"), models=HYPERBOLIC_MODELS_FULL, # Use the full names with prefix default_model=HYPERBOLIC_MODELS_FULL[-1], dropdown_label="Select Hyperbolic Model", choices=HYPERBOLIC_MODELS_DISPLAY, # Display names without prefix fill_height=True)
if __name__ == "__main__": demo.launch()512 unmodified lines513514515516516517518519512 unmodified lines # via anychat (pyproject.toml)yarl==1.18.3 # via aiohttpai-gradio[deepseek,crewai]==0.1.6ai-gradio[deepseek,crewai,hyperbolic]==0.1.7crewai==0.86.0instructor==1.3.3crewai-tools>=0.17.01234567891011121314151617181920212223242526272829303132333435363738394041424344import gradio as gr
def get_app( models: list[str], default_model: str, dropdown_label: str = "Select Hyperbolic Model", choices: list[str] = None, **kwargs,) -> gr.Blocks: display_choices = choices if choices is not None else models def update_model(new_model: str) -> list[gr.Column]: if choices is not None: idx = display_choices.index(new_model) new_model = models[idx] return [gr.Column(visible=model_name == new_model) for model_name in models]
with gr.Blocks(fill_height=True) as demo: model = gr.Dropdown( label=dropdown_label, choices=display_choices, value=choices[models.index(default_model)] if choices else default_model )
columns = [] for model_name in models: with gr.Column(visible=model_name == default_model) as column: load_kwargs = {k: v for k, v in kwargs.items() if k not in ['src', 'choices']} from ai_gradio.providers import registry gr.load(name=model_name, src=registry, **load_kwargs) columns.append(column)
model.change( fn=update_model, inputs=model, outputs=columns, api_name=False, queue=False, )
for fn in demo.fns.values(): fn.api_name = False
return demoapp.py+1-1
app_hyperbolic.py+19-21
requirements.txt+1-1
utils_hyperbolic.pyAdded+44