lixuejing
commited on
Commit
·
aad2d68
1
Parent(s):
ebed75c
fix
Browse files- src/submission/submit.py +15 -1
src/submission/submit.py
CHANGED
@@ -55,10 +55,23 @@ def add_new_eval(
|
|
55 |
if not base_model_on_hub:
|
56 |
return styled_error(f'Base model "{base_model}" {error}')
|
57 |
|
|
|
|
|
|
|
58 |
if not weight_type == "Adapter":
|
59 |
-
model_on_hub, error,
|
60 |
if not model_on_hub:
|
61 |
return styled_error(f'Model "{model}" {error}')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
62 |
|
63 |
# Is the model info correctly filled?
|
64 |
try:
|
@@ -85,6 +98,7 @@ def add_new_eval(
|
|
85 |
license = ""
|
86 |
likes = 0
|
87 |
tags = []
|
|
|
88 |
|
89 |
# Seems good, creating the eval
|
90 |
print("Adding new eval")
|
|
|
55 |
if not base_model_on_hub:
|
56 |
return styled_error(f'Base model "{base_model}" {error}')
|
57 |
|
58 |
+
architecture = "?"
|
59 |
+
downloads = 0
|
60 |
+
created_at = ""
|
61 |
if not weight_type == "Adapter":
|
62 |
+
model_on_hub, error, model_config = is_model_on_hub(model_name=model, revision=revision, test_tokenizer=True)
|
63 |
if not model_on_hub:
|
64 |
return styled_error(f'Model "{model}" {error}')
|
65 |
+
if model_config is not None:
|
66 |
+
architectures = getattr(model_config, "architectures", None)
|
67 |
+
if architectures:
|
68 |
+
architecture = ";".join(architectures)
|
69 |
+
downloads = getattr(model_config, 'downloads', 0)
|
70 |
+
created_at = getattr(model_config, 'created_at', '')
|
71 |
+
#if not weight_type == "Adapter":
|
72 |
+
# model_on_hub, error, _ = is_model_on_hub(model_name=model, revision=revision, token=TOKEN, test_tokenizer=True)
|
73 |
+
# if not model_on_hub:
|
74 |
+
# return styled_error(f'Model "{model}" {error}')
|
75 |
|
76 |
# Is the model info correctly filled?
|
77 |
try:
|
|
|
98 |
license = ""
|
99 |
likes = 0
|
100 |
tags = []
|
101 |
+
downloads = 0
|
102 |
|
103 |
# Seems good, creating the eval
|
104 |
print("Adding new eval")
|