SmilingWolf
commited on
Commit
•
727c462
1
Parent(s):
b82a8cd
Add auth token
Browse files
app.py
CHANGED
@@ -20,6 +20,7 @@ Image similarity-based retrieval tool using:
|
|
20 |
- [Faiss](https://github.com/facebookresearch/faiss) and [autofaiss](https://github.com/criteo/autofaiss) for indexing
|
21 |
"""
|
22 |
|
|
|
23 |
CONV_MODEL_REPO = "SmilingWolf/wd-v1-4-convnext-tagger-v2"
|
24 |
CONV_MODEL_REVISION = "v2.0"
|
25 |
CONV_FEXT_LAYER = "predictions_norm"
|
@@ -42,7 +43,11 @@ def download_model(model_repo, model_revision):
|
|
42 |
model_file_paths = []
|
43 |
for elem in model_files:
|
44 |
model_file_paths.append(
|
45 |
-
Path(
|
|
|
|
|
|
|
|
|
46 |
)
|
47 |
|
48 |
model_path = model_file_paths[0].parents[0]
|
|
|
20 |
- [Faiss](https://github.com/facebookresearch/faiss) and [autofaiss](https://github.com/criteo/autofaiss) for indexing
|
21 |
"""
|
22 |
|
23 |
+
HF_TOKEN = os.environ["HF_TOKEN"]
|
24 |
CONV_MODEL_REPO = "SmilingWolf/wd-v1-4-convnext-tagger-v2"
|
25 |
CONV_MODEL_REVISION = "v2.0"
|
26 |
CONV_FEXT_LAYER = "predictions_norm"
|
|
|
43 |
model_file_paths = []
|
44 |
for elem in model_files:
|
45 |
model_file_paths.append(
|
46 |
+
Path(
|
47 |
+
hf_hub_download(
|
48 |
+
model_repo, revision=model_revision, use_auth_token=HF_TOKEN, **elem
|
49 |
+
)
|
50 |
+
)
|
51 |
)
|
52 |
|
53 |
model_path = model_file_paths[0].parents[0]
|