Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
shigeki Ishida
commited on
Commit
·
c58b612
1
Parent(s):
862b7ac
Add llm-jp-eval version check to prevent duplicate submissions
Browse files
src/submission/check_validity.py
CHANGED
|
@@ -100,6 +100,11 @@ def already_submitted_models(requested_models_dir: str) -> set[str]:
|
|
| 100 |
continue
|
| 101 |
file_names.append(f"{info['model']}_{info['precision']}_{info['add_special_tokens']}")
|
| 102 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 103 |
# Select organisation
|
| 104 |
if info["model"].count("/") == 0 or "submitted_time" not in info:
|
| 105 |
continue
|
|
|
|
| 100 |
continue
|
| 101 |
file_names.append(f"{info['model']}_{info['precision']}_{info['add_special_tokens']}")
|
| 102 |
|
| 103 |
+
# バージョン情報を含むユニークIDを作成
|
| 104 |
+
file_names.append(
|
| 105 |
+
f"{info['model']}_{info['precision']}_{info['add_special_tokens']}_{info.get('llm_jp_eval_version', 'v1.4.1')}"
|
| 106 |
+
)
|
| 107 |
+
|
| 108 |
# Select organisation
|
| 109 |
if info["model"].count("/") == 0 or "submitted_time" not in info:
|
| 110 |
continue
|
src/submission/submit.py
CHANGED
|
@@ -3,6 +3,7 @@ import os
|
|
| 3 |
from datetime import datetime, timezone
|
| 4 |
|
| 5 |
from src.display.formatting import styled_error, styled_message, styled_warning
|
|
|
|
| 6 |
from src.envs import API, EVAL_REQUESTS_PATH, QUEUE_REPO, TOKEN
|
| 7 |
from src.submission.check_validity import already_submitted_models, check_model_card, get_model_size, is_model_on_hub
|
| 8 |
|
|
@@ -22,6 +23,13 @@ def add_new_eval(
|
|
| 22 |
if not REQUESTED_MODELS:
|
| 23 |
REQUESTED_MODELS, USERS_TO_SUBMISSION_DATES = already_submitted_models(EVAL_REQUESTS_PATH)
|
| 24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
user_name = ""
|
| 26 |
model_path = model
|
| 27 |
if "/" in model:
|
|
@@ -76,6 +84,7 @@ def add_new_eval(
|
|
| 76 |
"license": license,
|
| 77 |
"private": False,
|
| 78 |
"add_special_tokens": add_special_tokens,
|
|
|
|
| 79 |
}
|
| 80 |
|
| 81 |
# Check for duplicate submission
|
|
|
|
| 3 |
from datetime import datetime, timezone
|
| 4 |
|
| 5 |
from src.display.formatting import styled_error, styled_message, styled_warning
|
| 6 |
+
from src.display.utils import Version
|
| 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, get_model_size, is_model_on_hub
|
| 9 |
|
|
|
|
| 23 |
if not REQUESTED_MODELS:
|
| 24 |
REQUESTED_MODELS, USERS_TO_SUBMISSION_DATES = already_submitted_models(EVAL_REQUESTS_PATH)
|
| 25 |
|
| 26 |
+
current_version = Version.v1_4_1.value.name
|
| 27 |
+
|
| 28 |
+
# バージョン情報を含めた重複チェック
|
| 29 |
+
submission_id = f"{model}_{precision}_{add_special_tokens}_{current_version}"
|
| 30 |
+
if submission_id in REQUESTED_MODELS:
|
| 31 |
+
return styled_warning(f"This model has already been evaluated with llm-jp-eval version {current_version}")
|
| 32 |
+
|
| 33 |
user_name = ""
|
| 34 |
model_path = model
|
| 35 |
if "/" in model:
|
|
|
|
| 84 |
"license": license,
|
| 85 |
"private": False,
|
| 86 |
"add_special_tokens": add_special_tokens,
|
| 87 |
+
"llm_jp_eval_version": current_version,
|
| 88 |
}
|
| 89 |
|
| 90 |
# Check for duplicate submission
|