renpas22 commited on
Commit ·
714d05d
1
Parent(s): 917e40e
Force fresh repository download with cache clearing
Browse files- train_qwen_cot_dual.py +10 -2
train_qwen_cot_dual.py
CHANGED
|
@@ -26,14 +26,22 @@ import logging
|
|
| 26 |
# Clone repository if running in HF Jobs environment
|
| 27 |
if str(Path(__file__).parent) == "/tmp":
|
| 28 |
from huggingface_hub import snapshot_download
|
|
|
|
| 29 |
print("Running in HF Jobs - downloading repository...")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
repo_path = snapshot_download(
|
| 31 |
repo_id="Mulebot/dei-model",
|
| 32 |
repo_type="model",
|
| 33 |
-
local_dir=
|
| 34 |
token=os.environ.get("HF_TOKEN"),
|
| 35 |
revision="main", # Force latest version
|
| 36 |
-
force_download=
|
| 37 |
local_dir_use_symlinks=False, # Copy files instead of symlinks
|
| 38 |
)
|
| 39 |
repo_root = Path(repo_path)
|
|
|
|
| 26 |
# Clone repository if running in HF Jobs environment
|
| 27 |
if str(Path(__file__).parent) == "/tmp":
|
| 28 |
from huggingface_hub import snapshot_download
|
| 29 |
+
import shutil
|
| 30 |
print("Running in HF Jobs - downloading repository...")
|
| 31 |
+
|
| 32 |
+
# Clear any existing cache
|
| 33 |
+
cache_dir = "/tmp/dei-model"
|
| 34 |
+
if os.path.exists(cache_dir):
|
| 35 |
+
print(f"Clearing existing cache at {cache_dir}")
|
| 36 |
+
shutil.rmtree(cache_dir)
|
| 37 |
+
|
| 38 |
repo_path = snapshot_download(
|
| 39 |
repo_id="Mulebot/dei-model",
|
| 40 |
repo_type="model",
|
| 41 |
+
local_dir=cache_dir,
|
| 42 |
token=os.environ.get("HF_TOKEN"),
|
| 43 |
revision="main", # Force latest version
|
| 44 |
+
force_download=True, # Force fresh download, ignore cache
|
| 45 |
local_dir_use_symlinks=False, # Copy files instead of symlinks
|
| 46 |
)
|
| 47 |
repo_root = Path(repo_path)
|