Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -123,12 +123,11 @@ with gr.Blocks() as demo:
|
|
123 |
output_text = gr.Textbox(label="π Model Prediction", interactive=False)
|
124 |
|
125 |
# Toggle input fields based on model selection
|
126 |
-
def toggle_inputs(choice):
|
127 |
"""Toggle visibility of inputs based on model selection."""
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
|
133 |
model_selector.change(toggle_inputs, model_selector, [image_input, *feature_inputs])
|
134 |
|
|
|
123 |
output_text = gr.Textbox(label="π Model Prediction", interactive=False)
|
124 |
|
125 |
# Toggle input fields based on model selection
|
|
|
126 |
"""Toggle visibility of inputs based on model selection."""
|
127 |
+
def toggle_inputs(choice):
|
128 |
+
image_visibility = choice == "ViT"
|
129 |
+
feature_visibility = choice == "Neural Network"
|
130 |
+
return [gr.update(visible=image_visibility)] + [gr.update(visible=feature_visibility)] * len(feature_inputs)
|
131 |
|
132 |
model_selector.change(toggle_inputs, model_selector, [image_input, *feature_inputs])
|
133 |
|