Update app.py
Browse files
app.py
CHANGED
@@ -12,7 +12,7 @@ from huggingface_hub import hf_hub_download
|
|
12 |
|
13 |
from huggingface_hub import login
|
14 |
|
15 |
-
login(
|
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
|