sayakpaul HF staff commited on
Commit
6b34e0a
1 Parent(s): 64e2155

fix: token check.

Browse files
Files changed (1) hide show
  1. main.py +2 -2
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 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 f"### {hf_token is None}."
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: