Spaces:
Runtime error
Runtime error
Took care of main revision
Browse files- src/submission/submit.py +7 -2
src/submission/submit.py
CHANGED
@@ -82,13 +82,18 @@ def add_new_eval(
|
|
82 |
api = HfApi(token=oauth_token.token)
|
83 |
user_info = api.whoami()
|
84 |
|
|
|
|
|
|
|
|
|
|
|
85 |
# Seems good, creating the eval
|
86 |
print("Adding new eval")
|
87 |
|
88 |
eval_entry = {
|
89 |
"model": model,
|
90 |
"base_model": base_model,
|
91 |
-
"revision":
|
92 |
"precision": precision,
|
93 |
"weight_type": weight_type,
|
94 |
"status": "PENDING",
|
@@ -102,7 +107,7 @@ def add_new_eval(
|
|
102 |
}
|
103 |
|
104 |
# Check for duplicate submission
|
105 |
-
if f"{model}_{revision}_{precision}" in REQUESTED_MODELS:
|
106 |
return styled_warning("This model has been already submitted.")
|
107 |
|
108 |
print("Creating eval file")
|
|
|
82 |
api = HfApi(token=oauth_token.token)
|
83 |
user_info = api.whoami()
|
84 |
|
85 |
+
actual_revision = revision
|
86 |
+
if revision == 'main':
|
87 |
+
model_info = api.model_info(model)
|
88 |
+
actual_revision = model_info.sha
|
89 |
+
|
90 |
# Seems good, creating the eval
|
91 |
print("Adding new eval")
|
92 |
|
93 |
eval_entry = {
|
94 |
"model": model,
|
95 |
"base_model": base_model,
|
96 |
+
"revision": actual_revision,
|
97 |
"precision": precision,
|
98 |
"weight_type": weight_type,
|
99 |
"status": "PENDING",
|
|
|
107 |
}
|
108 |
|
109 |
# Check for duplicate submission
|
110 |
+
if f"{model}_{revision}_{precision}" in REQUESTED_MODELS or f"{model}_{actual_revision}_{precision}" in REQUESTED_MODELS:
|
111 |
return styled_warning("This model has been already submitted.")
|
112 |
|
113 |
print("Creating eval file")
|