Spaces:
Sleeping
Sleeping
fix: token check.
Browse files
main.py
CHANGED
@@ -33,14 +33,14 @@ model = tf.keras.applications.ResNet50(weights="imagenet")
|
|
33 |
|
34 |
def push_to_hub(hf_token: str, push_dir: str) -> str:
|
35 |
try:
|
36 |
-
if hf_token
|
37 |
return "### No HF token provided. Model won't be pushed."
|
38 |
else:
|
39 |
repo = Repository(local_dir=push_dir, token=hf_token)
|
40 |
commit_url = repo.push_to_hub()
|
41 |
return f"### Model successfully pushed: [{commit_url}]({commit_url})"
|
42 |
except:
|
43 |
-
return f"### {hf_token
|
44 |
|
45 |
|
46 |
def post_optimization(list_of_strs: List[str]) -> str:
|
|
|
33 |
|
34 |
def push_to_hub(hf_token: str, push_dir: str) -> str:
|
35 |
try:
|
36 |
+
if hf_token == "":
|
37 |
return "### No HF token provided. Model won't be pushed."
|
38 |
else:
|
39 |
repo = Repository(local_dir=push_dir, token=hf_token)
|
40 |
commit_url = repo.push_to_hub()
|
41 |
return f"### Model successfully pushed: [{commit_url}]({commit_url})"
|
42 |
except:
|
43 |
+
return f"### {hf_token == ''}."
|
44 |
|
45 |
|
46 |
def post_optimization(list_of_strs: List[str]) -> str:
|