Upload example_usage.py with huggingface_hub
Browse files- example_usage.py +4 -4
example_usage.py
CHANGED
|
@@ -37,14 +37,14 @@ def load_models_from_hf(repo_id: str, cache_dir: str = "./models_cache"):
|
|
| 37 |
print(" 📦 Loading color model...")
|
| 38 |
color_model_path = hf_hub_download(
|
| 39 |
repo_id=repo_id,
|
| 40 |
-
filename="color_model.pt",
|
| 41 |
cache_dir=cache_dir
|
| 42 |
)
|
| 43 |
|
| 44 |
# Loading vocabulary
|
| 45 |
vocab_path = hf_hub_download(
|
| 46 |
repo_id=repo_id,
|
| 47 |
-
filename=
|
| 48 |
cache_dir=cache_dir
|
| 49 |
)
|
| 50 |
|
|
@@ -66,7 +66,7 @@ def load_models_from_hf(repo_id: str, cache_dir: str = "./models_cache"):
|
|
| 66 |
print(" 📦 Loading hierarchy model...")
|
| 67 |
hierarchy_model_path = hf_hub_download(
|
| 68 |
repo_id=repo_id,
|
| 69 |
-
filename=
|
| 70 |
cache_dir=cache_dir
|
| 71 |
)
|
| 72 |
|
|
@@ -88,7 +88,7 @@ def load_models_from_hf(repo_id: str, cache_dir: str = "./models_cache"):
|
|
| 88 |
print(" 📦 Loading main CLIP model...")
|
| 89 |
main_model_path = hf_hub_download(
|
| 90 |
repo_id=repo_id,
|
| 91 |
-
filename=
|
| 92 |
cache_dir=cache_dir
|
| 93 |
)
|
| 94 |
|
|
|
|
| 37 |
print(" 📦 Loading color model...")
|
| 38 |
color_model_path = hf_hub_download(
|
| 39 |
repo_id=repo_id,
|
| 40 |
+
filename="models/color_model.pt",
|
| 41 |
cache_dir=cache_dir
|
| 42 |
)
|
| 43 |
|
| 44 |
# Loading vocabulary
|
| 45 |
vocab_path = hf_hub_download(
|
| 46 |
repo_id=repo_id,
|
| 47 |
+
filename="tokenizer_vocab.json",
|
| 48 |
cache_dir=cache_dir
|
| 49 |
)
|
| 50 |
|
|
|
|
| 66 |
print(" 📦 Loading hierarchy model...")
|
| 67 |
hierarchy_model_path = hf_hub_download(
|
| 68 |
repo_id=repo_id,
|
| 69 |
+
filename="models/hierarchy_model.pth",
|
| 70 |
cache_dir=cache_dir
|
| 71 |
)
|
| 72 |
|
|
|
|
| 88 |
print(" 📦 Loading main CLIP model...")
|
| 89 |
main_model_path = hf_hub_download(
|
| 90 |
repo_id=repo_id,
|
| 91 |
+
filename="models/gap_clip.pth",
|
| 92 |
cache_dir=cache_dir
|
| 93 |
)
|
| 94 |
|