Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Update utils.py
Browse files
utils.py
CHANGED
@@ -201,3 +201,17 @@ def process_model_size(size):
|
|
201 |
except (ValueError, TypeError):
|
202 |
return 'unknown'
|
203 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
201 |
except (ValueError, TypeError):
|
202 |
return 'unknown'
|
203 |
|
204 |
+
|
205 |
+
def filter_columns_by_subjects(df, selected_subjects=None):
|
206 |
+
if selected_subjects is None or len(selected_subjects) == 0:
|
207 |
+
return df[COLUMN_NAMES]
|
208 |
+
|
209 |
+
base_columns = ['Models', 'Model Size(B)', 'Data Source', 'Overall']
|
210 |
+
selected_columns = base_columns + selected_subjects
|
211 |
+
|
212 |
+
available_columns = [col for col in selected_columns if col in df.columns]
|
213 |
+
return df[available_columns]
|
214 |
+
|
215 |
+
def get_subject_choices():
|
216 |
+
return SUBJECTS
|
217 |
+
|