Spaces:
Running
Running
Joschka Strueber
commited on
Commit
·
ea91c80
1
Parent(s):
8fd0ade
[Fix] check version, fix dataset update
Browse files
app.py
CHANGED
@@ -7,6 +7,8 @@ from io import BytesIO
|
|
7 |
from PIL import Image
|
8 |
from huggingface_hub import login
|
9 |
|
|
|
|
|
10 |
from src.dataloading import get_leaderboard_models_cached, get_leaderboard_datasets
|
11 |
from src.similarity import load_data_and_compute_similarities
|
12 |
|
@@ -66,13 +68,9 @@ def validate_inputs(selected_models, selected_dataset):
|
|
66 |
|
67 |
|
68 |
def update_datasets_based_on_models(selected_models, current_dataset):
|
69 |
-
# Get available datasets for selected models
|
70 |
available_datasets = get_leaderboard_datasets(selected_models) if selected_models else []
|
71 |
-
|
72 |
-
# Check if current dataset is still valid
|
73 |
valid_dataset = current_dataset if current_dataset in available_datasets else None
|
74 |
-
|
75 |
-
return gr.Dropdown.update(
|
76 |
choices=available_datasets,
|
77 |
value=valid_dataset
|
78 |
)
|
|
|
7 |
from PIL import Image
|
8 |
from huggingface_hub import login
|
9 |
|
10 |
+
print(gr.__version__)
|
11 |
+
|
12 |
from src.dataloading import get_leaderboard_models_cached, get_leaderboard_datasets
|
13 |
from src.similarity import load_data_and_compute_similarities
|
14 |
|
|
|
68 |
|
69 |
|
70 |
def update_datasets_based_on_models(selected_models, current_dataset):
|
|
|
71 |
available_datasets = get_leaderboard_datasets(selected_models) if selected_models else []
|
|
|
|
|
72 |
valid_dataset = current_dataset if current_dataset in available_datasets else None
|
73 |
+
return gr.update(
|
|
|
74 |
choices=available_datasets,
|
75 |
value=valid_dataset
|
76 |
)
|