Fix type annotation
Browse files12345678910111213142 unmodified lines171819202122232425262728293031328 unmodified lines41424344import gradio as grdef 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 modelsdef update_model(new_model: str) -> list[gr.Column]:if choices is not None:idx = display_choices.index(new_model)2 unmodified lineswith 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 registrygr.load(name=model_name, src=registry, **load_kwargs)columns.append(column)8 unmodified linesfor fn in demo.fns.values():fn.api_name = Falsereturn demo1234567891011121314152 unmodified lines18192021222324252627282930313233348 unmodified lines43444546import gradio as grdef get_app(models: list[str],default_model: str,dropdown_label: str = "Select Hyperbolic Model",choices: list[str] | None = None,**kwargs, # noqa: ANN003) -> gr.Blocks:display_choices = choices if choices is not None else modelsdef update_model(new_model: str) -> list[gr.Column]:if choices is not None:idx = display_choices.index(new_model)2 unmodified lineswith 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 registrygr.load(name=model_name, src=registry, **load_kwargs)columns.append(column)8 unmodified linesfor fn in demo.fns.values():fn.api_name = Falsereturn demo
utils_ai_gradio.py+9-7