Spaces:
Sleeping
Sleeping
debug: token.
Browse files
main.py
CHANGED
@@ -34,13 +34,13 @@ model = tf.keras.applications.ResNet50(weights="imagenet")
|
|
34 |
def push_to_hub(hf_token: str, push_dir: str) -> str:
|
35 |
try:
|
36 |
if hf_token is None:
|
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
|
44 |
|
45 |
|
46 |
def post_optimization(list_of_strs: List[str]) -> str:
|
@@ -75,7 +75,7 @@ def run(hf_token: str) -> str:
|
|
75 |
# benchmark_str += "\n"
|
76 |
benchmark_str = push_to_hub(hf_token, tensorrt_path)
|
77 |
|
78 |
-
return
|
79 |
|
80 |
|
81 |
def launch_gradio():
|
|
|
34 |
def push_to_hub(hf_token: str, push_dir: str) -> str:
|
35 |
try:
|
36 |
if hf_token is None:
|
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 "### Error happened."
|
44 |
|
45 |
|
46 |
def post_optimization(list_of_strs: List[str]) -> str:
|
|
|
75 |
# benchmark_str += "\n"
|
76 |
benchmark_str = push_to_hub(hf_token, tensorrt_path)
|
77 |
|
78 |
+
return benchmark_str
|
79 |
|
80 |
|
81 |
def launch_gradio():
|