Spaces:
Running
Running
Commit
·
c7bef08
1
Parent(s):
947816c
allow unselect filters
Browse files- app_leaderboard.py +4 -2
- wordings.py +7 -0
app_leaderboard.py
CHANGED
|
@@ -29,6 +29,7 @@ def get_model_ids(ds):
|
|
| 29 |
models = ds["model_id"].tolist()
|
| 30 |
# return unique elements in the list model_ids
|
| 31 |
model_ids = list(set(models))
|
|
|
|
| 32 |
return model_ids
|
| 33 |
|
| 34 |
|
|
@@ -36,6 +37,7 @@ def get_dataset_ids(ds):
|
|
| 36 |
logging.info(f"Dataset {ds} column names: {ds['dataset_id']}")
|
| 37 |
datasets = ds["dataset_id"].tolist()
|
| 38 |
dataset_ids = list(set(datasets))
|
|
|
|
| 39 |
return dataset_ids
|
| 40 |
|
| 41 |
|
|
@@ -121,9 +123,9 @@ def get_demo():
|
|
| 121 |
df = records[(records["task"] == task)]
|
| 122 |
# filter the table based on the model_id and dataset_id
|
| 123 |
if model_id:
|
| 124 |
-
df =
|
| 125 |
if dataset_id:
|
| 126 |
-
df =
|
| 127 |
|
| 128 |
# filter the table based on the columns
|
| 129 |
df = df[columns]
|
|
|
|
| 29 |
models = ds["model_id"].tolist()
|
| 30 |
# return unique elements in the list model_ids
|
| 31 |
model_ids = list(set(models))
|
| 32 |
+
model_ids.insert(0, None)
|
| 33 |
return model_ids
|
| 34 |
|
| 35 |
|
|
|
|
| 37 |
logging.info(f"Dataset {ds} column names: {ds['dataset_id']}")
|
| 38 |
datasets = ds["dataset_id"].tolist()
|
| 39 |
dataset_ids = list(set(datasets))
|
| 40 |
+
dataset_ids.insert(0, None)
|
| 41 |
return dataset_ids
|
| 42 |
|
| 43 |
|
|
|
|
| 123 |
df = records[(records["task"] == task)]
|
| 124 |
# filter the table based on the model_id and dataset_id
|
| 125 |
if model_id:
|
| 126 |
+
df = df[(df['model_id'] == model_id)]
|
| 127 |
if dataset_id:
|
| 128 |
+
df = df[(df['dataset_id'] == dataset_id)]
|
| 129 |
|
| 130 |
# filter the table based on the columns
|
| 131 |
df = df[columns]
|
wordings.py
CHANGED
|
@@ -20,3 +20,10 @@ CONFIRM_MAPPING_DETAILS_FAIL_MD = """
|
|
| 20 |
CONFIRM_MAPPING_DETAILS_FAIL_RAW = """
|
| 21 |
Sorry, we cannot align the input/output of your dataset with the model. Pleaser double check your model and dataset.
|
| 22 |
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
CONFIRM_MAPPING_DETAILS_FAIL_RAW = """
|
| 21 |
Sorry, we cannot align the input/output of your dataset with the model. Pleaser double check your model and dataset.
|
| 22 |
"""
|
| 23 |
+
|
| 24 |
+
PREDICTION_SAMPLE_MD = """
|
| 25 |
+
<h1 style="text-align: center;">
|
| 26 |
+
Model Prediction Sample
|
| 27 |
+
</h1>
|
| 28 |
+
Here is a sample prediction from your model based on your dataset.
|
| 29 |
+
"""
|