Spaces:
Runtime error
Runtime error
pminervini
commited on
Commit
•
4476a5b
1
Parent(s):
1793c69
update
Browse files
src/submission/check_validity.py
CHANGED
@@ -42,7 +42,7 @@ def check_model_card(repo_id: str) -> tuple[bool, str]:
|
|
42 |
|
43 |
def is_model_on_hub(model_name: str, revision: str, token: str = None, trust_remote_code=False, test_tokenizer=False) -> tuple[bool, Optional[str], Optional[AutoConfig]]:
|
44 |
try:
|
45 |
-
config = AutoConfig.from_pretrained(model_name, revision=revision, trust_remote_code=trust_remote_code, token=token)
|
46 |
if test_tokenizer:
|
47 |
try:
|
48 |
AutoTokenizer.from_pretrained(model_name, revision=revision, trust_remote_code=trust_remote_code, token=token)
|
|
|
42 |
|
43 |
def is_model_on_hub(model_name: str, revision: str, token: str = None, trust_remote_code=False, test_tokenizer=False) -> tuple[bool, Optional[str], Optional[AutoConfig]]:
|
44 |
try:
|
45 |
+
config = AutoConfig.from_pretrained(model_name, revision=revision, trust_remote_code=trust_remote_code, token=token)
|
46 |
if test_tokenizer:
|
47 |
try:
|
48 |
AutoTokenizer.from_pretrained(model_name, revision=revision, trust_remote_code=trust_remote_code, token=token)
|
src/submission/submit.py
CHANGED
@@ -61,12 +61,12 @@ def add_new_eval(
|
|
61 |
|
62 |
# Is the model on the hub?
|
63 |
if weight_type in ["Delta", "Adapter"]:
|
64 |
-
base_model_on_hub, error, _ = is_model_on_hub(model_name=base_model, revision=revision, token=H4_TOKEN, test_tokenizer=
|
65 |
if not base_model_on_hub:
|
66 |
return styled_error(f'Base model "{base_model}" {error}')
|
67 |
|
68 |
if not weight_type == "Adapter":
|
69 |
-
model_on_hub, error, _ = is_model_on_hub(model_name=model, revision=revision, test_tokenizer=
|
70 |
if not model_on_hub:
|
71 |
return styled_error(f'Model "{model}" {error}')
|
72 |
|
|
|
61 |
|
62 |
# Is the model on the hub?
|
63 |
if weight_type in ["Delta", "Adapter"]:
|
64 |
+
base_model_on_hub, error, _ = is_model_on_hub(model_name=base_model, revision=revision, token=H4_TOKEN, test_tokenizer=False)
|
65 |
if not base_model_on_hub:
|
66 |
return styled_error(f'Base model "{base_model}" {error}')
|
67 |
|
68 |
if not weight_type == "Adapter":
|
69 |
+
model_on_hub, error, _ = is_model_on_hub(model_name=model, revision=revision, test_tokenizer=False)
|
70 |
if not model_on_hub:
|
71 |
return styled_error(f'Model "{model}" {error}')
|
72 |
|