future-xy
commited on
Commit
•
581fdbd
1
Parent(s):
a317a5f
fix a bug
Browse files- app.py +1 -0
- src/leaderboard/read_evals.py +3 -2
- src/submission/submit.py +4 -0
app.py
CHANGED
@@ -369,6 +369,7 @@ with demo:
|
|
369 |
private,
|
370 |
weight_type,
|
371 |
model_type,
|
|
|
372 |
],
|
373 |
submission_result,
|
374 |
)
|
|
|
369 |
private,
|
370 |
weight_type,
|
371 |
model_type,
|
372 |
+
inference_framework,
|
373 |
],
|
374 |
submission_result,
|
375 |
)
|
src/leaderboard/read_evals.py
CHANGED
@@ -49,8 +49,6 @@ class EvalResult:
|
|
49 |
with open(json_filepath) as fp:
|
50 |
data = json.load(fp)
|
51 |
|
52 |
-
inference_framework = data.get("inference_framework", "Unknown")
|
53 |
-
|
54 |
# We manage the legacy config format
|
55 |
config = data.get("config", data.get("config_general", None))
|
56 |
|
@@ -61,6 +59,9 @@ class EvalResult:
|
|
61 |
org_and_model = config.get("model_name", config.get("model_args", None))
|
62 |
org_and_model = org_and_model.split("/", 1)
|
63 |
|
|
|
|
|
|
|
64 |
if len(org_and_model) == 1:
|
65 |
org = None
|
66 |
model = org_and_model[0]
|
|
|
49 |
with open(json_filepath) as fp:
|
50 |
data = json.load(fp)
|
51 |
|
|
|
|
|
52 |
# We manage the legacy config format
|
53 |
config = data.get("config", data.get("config_general", None))
|
54 |
|
|
|
59 |
org_and_model = config.get("model_name", config.get("model_args", None))
|
60 |
org_and_model = org_and_model.split("/", 1)
|
61 |
|
62 |
+
# Get inference framework
|
63 |
+
inference_framework = config.get("inference_framework", "Unknown")
|
64 |
+
|
65 |
if len(org_and_model) == 1:
|
66 |
org = None
|
67 |
model = org_and_model[0]
|
src/submission/submit.py
CHANGED
@@ -25,6 +25,7 @@ def add_new_eval(
|
|
25 |
private: bool,
|
26 |
weight_type: str,
|
27 |
model_type: str,
|
|
|
28 |
):
|
29 |
global REQUESTED_MODELS
|
30 |
global USERS_TO_SUBMISSION_DATES
|
@@ -85,6 +86,8 @@ def add_new_eval(
|
|
85 |
license = model_info.cardData["license"]
|
86 |
except Exception:
|
87 |
return styled_error("Please select a license for your model")
|
|
|
|
|
88 |
|
89 |
modelcard_OK, error_msg = check_model_card(model)
|
90 |
if not modelcard_OK:
|
@@ -106,6 +109,7 @@ def add_new_eval(
|
|
106 |
"likes": model_info.likes,
|
107 |
"params": model_size,
|
108 |
"license": license,
|
|
|
109 |
}
|
110 |
|
111 |
# Check for duplicate submission
|
|
|
25 |
private: bool,
|
26 |
weight_type: str,
|
27 |
model_type: str,
|
28 |
+
inference_framework: str,
|
29 |
):
|
30 |
global REQUESTED_MODELS
|
31 |
global USERS_TO_SUBMISSION_DATES
|
|
|
86 |
license = model_info.cardData["license"]
|
87 |
except Exception:
|
88 |
return styled_error("Please select a license for your model")
|
89 |
+
|
90 |
+
# TODO: Check if the inference framework is valid
|
91 |
|
92 |
modelcard_OK, error_msg = check_model_card(model)
|
93 |
if not modelcard_OK:
|
|
|
109 |
"likes": model_info.likes,
|
110 |
"params": model_size,
|
111 |
"license": license,
|
112 |
+
"inference_framework": inference_framework,
|
113 |
}
|
114 |
|
115 |
# Check for duplicate submission
|