Spaces:
Runtime error
Runtime error
Andrea Seveso
commited on
Commit
·
4dadd44
1
Parent(s):
1e1adf6
Remove weight type
Browse files- src/submission/submit.py +4 -15
src/submission/submit.py
CHANGED
@@ -14,18 +14,19 @@ from src.submission.check_validity import (
|
|
14 |
REQUESTED_MODELS = None
|
15 |
USERS_TO_SUBMISSION_DATES = None
|
16 |
|
|
|
17 |
def add_new_eval(
|
18 |
model: str,
|
19 |
base_model: str,
|
20 |
revision: str,
|
21 |
precision: str,
|
22 |
-
weight_type: str,
|
23 |
model_type: str,
|
24 |
):
|
25 |
global REQUESTED_MODELS
|
26 |
global USERS_TO_SUBMISSION_DATES
|
27 |
if not REQUESTED_MODELS:
|
28 |
-
REQUESTED_MODELS, USERS_TO_SUBMISSION_DATES = already_submitted_models(
|
|
|
29 |
|
30 |
user_name = ""
|
31 |
model_path = model
|
@@ -43,17 +44,6 @@ def add_new_eval(
|
|
43 |
if revision == "":
|
44 |
revision = "main"
|
45 |
|
46 |
-
# Is the model on the hub?
|
47 |
-
if weight_type in ["Delta", "Adapter"]:
|
48 |
-
base_model_on_hub, error, _ = is_model_on_hub(model_name=base_model, revision=revision, token=TOKEN, test_tokenizer=True)
|
49 |
-
if not base_model_on_hub:
|
50 |
-
return styled_error(f'Base model "{base_model}" {error}')
|
51 |
-
|
52 |
-
if not weight_type == "Adapter":
|
53 |
-
model_on_hub, error, _ = is_model_on_hub(model_name=model, revision=revision, token=TOKEN, test_tokenizer=True)
|
54 |
-
if not model_on_hub:
|
55 |
-
return styled_error(f'Model "{model}" {error}')
|
56 |
-
|
57 |
# Is the model info correctly filled?
|
58 |
try:
|
59 |
model_info = API.model_info(repo_id=model, revision=revision)
|
@@ -80,7 +70,6 @@ def add_new_eval(
|
|
80 |
"base_model": base_model,
|
81 |
"revision": revision,
|
82 |
"precision": precision,
|
83 |
-
"weight_type": weight_type,
|
84 |
"status": "PENDING",
|
85 |
"submitted_time": current_time,
|
86 |
"model_type": model_type,
|
@@ -97,7 +86,7 @@ def add_new_eval(
|
|
97 |
print("Creating eval file")
|
98 |
OUT_DIR = f"{EVAL_REQUESTS_PATH}/{user_name}"
|
99 |
os.makedirs(OUT_DIR, exist_ok=True)
|
100 |
-
out_path = f"{OUT_DIR}/{model_path}_eval_request_False_{precision}
|
101 |
|
102 |
with open(out_path, "w") as f:
|
103 |
f.write(json.dumps(eval_entry))
|
|
|
14 |
REQUESTED_MODELS = None
|
15 |
USERS_TO_SUBMISSION_DATES = None
|
16 |
|
17 |
+
|
18 |
def add_new_eval(
|
19 |
model: str,
|
20 |
base_model: str,
|
21 |
revision: str,
|
22 |
precision: str,
|
|
|
23 |
model_type: str,
|
24 |
):
|
25 |
global REQUESTED_MODELS
|
26 |
global USERS_TO_SUBMISSION_DATES
|
27 |
if not REQUESTED_MODELS:
|
28 |
+
REQUESTED_MODELS, USERS_TO_SUBMISSION_DATES = already_submitted_models(
|
29 |
+
EVAL_REQUESTS_PATH)
|
30 |
|
31 |
user_name = ""
|
32 |
model_path = model
|
|
|
44 |
if revision == "":
|
45 |
revision = "main"
|
46 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
# Is the model info correctly filled?
|
48 |
try:
|
49 |
model_info = API.model_info(repo_id=model, revision=revision)
|
|
|
70 |
"base_model": base_model,
|
71 |
"revision": revision,
|
72 |
"precision": precision,
|
|
|
73 |
"status": "PENDING",
|
74 |
"submitted_time": current_time,
|
75 |
"model_type": model_type,
|
|
|
86 |
print("Creating eval file")
|
87 |
OUT_DIR = f"{EVAL_REQUESTS_PATH}/{user_name}"
|
88 |
os.makedirs(OUT_DIR, exist_ok=True)
|
89 |
+
out_path = f"{OUT_DIR}/{model_path}_eval_request_False_{precision}.json"
|
90 |
|
91 |
with open(out_path, "w") as f:
|
92 |
f.write(json.dumps(eval_entry))
|