Spaces:
Running
on
Zero
Running
on
Zero
Temporary workaround of https://github.com/gradio-app/gradio/issues/9923
Browse files
utils.py
CHANGED
@@ -13,13 +13,18 @@ def get_app(
|
|
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:
|
21 |
with gr.Column(visible=model_name == default_model) as column:
|
22 |
-
|
|
|
|
|
|
|
23 |
columns.append(column)
|
24 |
|
25 |
model.change(
|
|
|
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 |
+
chatbots = [gr.Chatbot(height=750) for _ in models]
|
17 |
+
|
18 |
with gr.Blocks() as demo:
|
19 |
model = gr.Dropdown(label="Select Model", choices=models, value=default_model)
|
20 |
|
21 |
columns = []
|
22 |
+
for model_name, chatbot in zip(models, chatbots):
|
23 |
with gr.Column(visible=model_name == default_model) as column:
|
24 |
+
if src != "models":
|
25 |
+
gr.load(name=model_name, src=src, accept_token=accept_token, chatbot=chatbot, **kwargs)
|
26 |
+
else:
|
27 |
+
gr.load(name=model_name, src=src, accept_token=accept_token, **kwargs)
|
28 |
columns.append(column)
|
29 |
|
30 |
model.change(
|