Adam Jirkovsky
commited on
Commit
·
6344c55
1
Parent(s):
0e88066
Fix result processing
Browse files- src/display/utils.py +1 -0
- src/submission/submit.py +6 -5
src/display/utils.py
CHANGED
@@ -181,6 +181,7 @@ EVAL_COLS = [c.name for c in fields(EvalQueueColumn)]
|
|
181 |
EVAL_TYPES = [c.type for c in fields(EvalQueueColumn)]
|
182 |
|
183 |
BENCHMARK_COLS = [HEADER_MAP[t.value.col_name] for t in Tasks]
|
|
|
184 |
|
185 |
NUMERIC_INTERVALS = {
|
186 |
"?": pd.Interval(-1, 0, closed="right"),
|
|
|
181 |
EVAL_TYPES = [c.type for c in fields(EvalQueueColumn)]
|
182 |
|
183 |
BENCHMARK_COLS = [HEADER_MAP[t.value.col_name] for t in Tasks]
|
184 |
+
BENCHMARK_COL_IDS = [t.value.col_name for t in Tasks]
|
185 |
|
186 |
NUMERIC_INTERVALS = {
|
187 |
"?": pd.Interval(-1, 0, closed="right"),
|
src/submission/submit.py
CHANGED
@@ -15,6 +15,7 @@ from src.submission.check_validity import (
|
|
15 |
|
16 |
from src.display.utils import (
|
17 |
BENCHMARK_COLS,
|
|
|
18 |
COLS
|
19 |
)
|
20 |
|
@@ -46,19 +47,19 @@ def add_new_eval(
|
|
46 |
|
47 |
for k, v in results.items():
|
48 |
for acc_k in acc_keys:
|
49 |
-
if acc_k in v and k in
|
50 |
ret[k] = v[acc_k]
|
51 |
#validation
|
52 |
for k,v in ret.items():
|
53 |
if k in ['eval_name', 'precision', 'hf_model_id', 'contact_email']:
|
54 |
continue
|
55 |
-
if k not in
|
56 |
print(f"Missing: {k}")
|
57 |
-
return styled_error(f'Missing: {k}')
|
58 |
|
59 |
-
if len(
|
60 |
print(f"Missing columns")
|
61 |
-
return styled_error(f'Missing columns')
|
62 |
|
63 |
# TODO add complex validation
|
64 |
#print(results.keys())
|
|
|
15 |
|
16 |
from src.display.utils import (
|
17 |
BENCHMARK_COLS,
|
18 |
+
BENCHMARK_COL_IDS,
|
19 |
COLS
|
20 |
)
|
21 |
|
|
|
47 |
|
48 |
for k, v in results.items():
|
49 |
for acc_k in acc_keys:
|
50 |
+
if acc_k in v and k in BENCHMARK_COL_IDS:
|
51 |
ret[k] = v[acc_k]
|
52 |
#validation
|
53 |
for k,v in ret.items():
|
54 |
if k in ['eval_name', 'precision', 'hf_model_id', 'contact_email']:
|
55 |
continue
|
56 |
+
if k not in BENCHMARK_COL_IDS:
|
57 |
print(f"Missing: {k}")
|
58 |
+
return styled_error(f'Missing: {k}'), "", "", "", ""
|
59 |
|
60 |
+
if len(BENCHMARK_COL_IDS) != len(ret) - 4:
|
61 |
print(f"Missing columns")
|
62 |
+
return styled_error(f'Missing columns'), "", "", "", ""
|
63 |
|
64 |
# TODO add complex validation
|
65 |
#print(results.keys())
|