Upload convert_vision_model.py with huggingface_hub
Browse files- convert_vision_model.py +8 -1
convert_vision_model.py
CHANGED
|
@@ -12,6 +12,7 @@
|
|
| 12 |
# "safetensors",
|
| 13 |
# "pillow",
|
| 14 |
# "unsloth @ git+https://github.com/unslothai/unsloth.git",
|
|
|
|
| 15 |
# "xformers",
|
| 16 |
# ]
|
| 17 |
# ///
|
|
@@ -32,7 +33,13 @@ Environment variables:
|
|
| 32 |
import os
|
| 33 |
import torch
|
| 34 |
from transformers import AutoModel, AutoTokenizer, AutoProcessor
|
| 35 |
-
from huggingface_hub import HfApi, hf_hub_download
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
import subprocess
|
| 37 |
import shutil
|
| 38 |
import glob
|
|
|
|
| 12 |
# "safetensors",
|
| 13 |
# "pillow",
|
| 14 |
# "unsloth @ git+https://github.com/unslothai/unsloth.git",
|
| 15 |
+
# "unsloth_zoo",
|
| 16 |
# "xformers",
|
| 17 |
# ]
|
| 18 |
# ///
|
|
|
|
| 33 |
import os
|
| 34 |
import torch
|
| 35 |
from transformers import AutoModel, AutoTokenizer, AutoProcessor
|
| 36 |
+
from huggingface_hub import HfApi, hf_hub_download, login
|
| 37 |
+
|
| 38 |
+
# Login with HF_TOKEN for private repo access
|
| 39 |
+
hf_token = os.environ.get("HF_TOKEN")
|
| 40 |
+
if hf_token:
|
| 41 |
+
login(token=hf_token)
|
| 42 |
+
print("Logged in to Hugging Face Hub")
|
| 43 |
import subprocess
|
| 44 |
import shutil
|
| 45 |
import glob
|