anttirauhala commited on
Commit
401d107
·
verified ·
1 Parent(s): ac72ab2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -12,7 +12,7 @@ from huggingface_hub import hf_hub_download
12
 
13
  from huggingface_hub import login
14
 
15
- login(mytoken = os.environ["HUGGINGFACE_TOKEN"],add_to_git_credential=True)
16
 
17
 
18
  # In a Hugging Face Space, authentication is handled by the environment
@@ -24,8 +24,7 @@ try:
24
  # First try with force_download
25
  model_path = hf_hub_download(repo_id="tech4humans/yolov8s-signature-detector",
26
  filename="yolov8s.pt",
27
- force_download=True,
28
- token=mytoken) # Force download for Space environment
29
  except Exception as force_error:
30
  print(f"Force download failed: {str(force_error)}")
31
  # Try again without force_download
 
12
 
13
  from huggingface_hub import login
14
 
15
+ login(token = os.environ["HUGGINGFACE_TOKEN"],add_to_git_credential=True)
16
 
17
 
18
  # In a Hugging Face Space, authentication is handled by the environment
 
24
  # First try with force_download
25
  model_path = hf_hub_download(repo_id="tech4humans/yolov8s-signature-detector",
26
  filename="yolov8s.pt",
27
+ force_download=True) # Force download for Space environment
 
28
  except Exception as force_error:
29
  print(f"Force download failed: {str(force_error)}")
30
  # Try again without force_download