Spaces:
Running
Running
Update utils_v2.py
Browse files- utils_v2.py +4 -1
utils_v2.py
CHANGED
|
@@ -76,7 +76,10 @@ def load_scores(raw_scores=None):
|
|
| 76 |
for sub_task, datasets in datasets_list.items(): # Ex.: ('I-CLS', ['VOC2007', 'N24News', ...])
|
| 77 |
for dataset in datasets: # Ex.: 'VOC2007'
|
| 78 |
score = raw_scores.get(modality, {}).get(dataset, 0.0)
|
| 79 |
-
|
|
|
|
|
|
|
|
|
|
| 80 |
metric = SPECIAL_METRICS.get(dataset, 'hit@1')
|
| 81 |
if isinstance(score, dict):
|
| 82 |
if modality == 'visdoc':
|
|
|
|
| 76 |
for sub_task, datasets in datasets_list.items(): # Ex.: ('I-CLS', ['VOC2007', 'N24News', ...])
|
| 77 |
for dataset in datasets: # Ex.: 'VOC2007'
|
| 78 |
score = raw_scores.get(modality, {}).get(dataset, 0.0)
|
| 79 |
+
try:
|
| 80 |
+
score = float(score)
|
| 81 |
+
except ValueError:
|
| 82 |
+
score = 0.0
|
| 83 |
metric = SPECIAL_METRICS.get(dataset, 'hit@1')
|
| 84 |
if isinstance(score, dict):
|
| 85 |
if modality == 'visdoc':
|