Temporary workaround of https://github.com/gradio-app/gradio/issues/9923
Browse files12 unmodified lines131415161718192021202223242526222728293012 unmodified lines def update_model(new_model: str) -> list[gr.Column]: return [gr.Column(visible=model_name == new_model) for model_name in models]
chatbots = [gr.Chatbot(height=750) for _ in models]
with gr.Blocks() as demo: model = gr.Dropdown(label="Select Model", choices=models, value=default_model)
columns = [] for model_name in models: for model_name, chatbot in zip(models, chatbots): with gr.Column(visible=model_name == default_model) as column: if src != "models": gr.load(name=model_name, src=src, accept_token=accept_token, chatbot=chatbot, **kwargs) else: gr.load(name=model_name, src=src, accept_token=accept_token, **kwargs) gr.load(name=model_name, src=src, accept_token=accept_token, **kwargs) columns.append(column)
model.change(utils.py+7-2