Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Submit only required fields
Browse files- src/submission/submit.py +7 -21
src/submission/submit.py
CHANGED
@@ -5,7 +5,7 @@ from datetime import datetime, timezone
|
|
5 |
from src.display.formatting import styled_error, styled_message, styled_warning
|
6 |
from src.display.utils import Version, VllmVersion
|
7 |
from src.envs import API, EVAL_REQUESTS_PATH, QUEUE_REPO, TOKEN
|
8 |
-
from src.submission.check_validity import already_submitted_models, check_model_card,
|
9 |
|
10 |
REQUESTED_MODELS = None
|
11 |
USERS_TO_SUBMISSION_DATES = None
|
@@ -48,14 +48,7 @@ def add_new_eval(
|
|
48 |
revision = "main"
|
49 |
|
50 |
# Is the model on the hub?
|
51 |
-
model_on_hub, error,
|
52 |
-
model_name=model, revision=revision, token=TOKEN, test_tokenizer=True
|
53 |
-
)
|
54 |
-
architecture = "?"
|
55 |
-
if model_config is not None:
|
56 |
-
architectures = getattr(model_config, "architectures", None)
|
57 |
-
if architectures:
|
58 |
-
architecture = ";".join(architectures)
|
59 |
if not model_on_hub:
|
60 |
return styled_error(f'Model "{model}" {error}')
|
61 |
|
@@ -65,11 +58,9 @@ def add_new_eval(
|
|
65 |
except Exception:
|
66 |
return styled_error("Could not get your model information. Please fill it up properly.")
|
67 |
|
68 |
-
model_size = get_model_size(model_info=model_info, precision=precision)
|
69 |
-
|
70 |
# Were the model card and license filled?
|
71 |
try:
|
72 |
-
|
73 |
except Exception:
|
74 |
return styled_error("Please select a license for your model")
|
75 |
|
@@ -81,20 +72,15 @@ def add_new_eval(
|
|
81 |
print("Adding new eval")
|
82 |
|
83 |
eval_entry = {
|
|
|
84 |
"model": model,
|
85 |
-
"revision": revision,
|
86 |
"precision": precision,
|
87 |
-
"
|
88 |
-
"submitted_time": current_time,
|
89 |
-
"model_type": model_type,
|
90 |
-
"likes": model_info.likes,
|
91 |
-
"params": model_size,
|
92 |
-
"license": license,
|
93 |
-
"private": False,
|
94 |
"add_special_tokens": add_special_tokens,
|
95 |
"llm_jp_eval_version": current_version,
|
96 |
-
"architecture": architecture,
|
97 |
"vllm_version": current_vllm_version,
|
|
|
|
|
98 |
}
|
99 |
|
100 |
# Check for duplicate submission
|
|
|
5 |
from src.display.formatting import styled_error, styled_message, styled_warning
|
6 |
from src.display.utils import Version, VllmVersion
|
7 |
from src.envs import API, EVAL_REQUESTS_PATH, QUEUE_REPO, TOKEN
|
8 |
+
from src.submission.check_validity import already_submitted_models, check_model_card, is_model_on_hub
|
9 |
|
10 |
REQUESTED_MODELS = None
|
11 |
USERS_TO_SUBMISSION_DATES = None
|
|
|
48 |
revision = "main"
|
49 |
|
50 |
# Is the model on the hub?
|
51 |
+
model_on_hub, error, _ = is_model_on_hub(model_name=model, revision=revision, token=TOKEN, test_tokenizer=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
if not model_on_hub:
|
53 |
return styled_error(f'Model "{model}" {error}')
|
54 |
|
|
|
58 |
except Exception:
|
59 |
return styled_error("Could not get your model information. Please fill it up properly.")
|
60 |
|
|
|
|
|
61 |
# Were the model card and license filled?
|
62 |
try:
|
63 |
+
_ = model_info.cardData["license"]
|
64 |
except Exception:
|
65 |
return styled_error("Please select a license for your model")
|
66 |
|
|
|
72 |
print("Adding new eval")
|
73 |
|
74 |
eval_entry = {
|
75 |
+
"model_type": model_type,
|
76 |
"model": model,
|
|
|
77 |
"precision": precision,
|
78 |
+
"revision": revision,
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
"add_special_tokens": add_special_tokens,
|
80 |
"llm_jp_eval_version": current_version,
|
|
|
81 |
"vllm_version": current_vllm_version,
|
82 |
+
"status": "PENDING",
|
83 |
+
"submitted_time": current_time,
|
84 |
}
|
85 |
|
86 |
# Check for duplicate submission
|