Skip to content
This repository was archived by the owner on Sep 10, 2025. It is now read-only.

Commit 0ca3941

Browse files
author
vmpuri
committed
Delete models from old location for huggingface download
1 parent a4aaccf commit 0ca3941

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

torchchat/cli/download.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,12 @@ def download_and_convert(
149149
model_config.distribution_channel
150150
== ModelDistributionChannel.HuggingFaceSnapshot
151151
):
152+
# Check if model is already downloaded in the old location
153+
154+
if os.path.exists(models_dir / model_config.name):
155+
print(f"Found model artifacts in {models_dir / model_config.name}. Downloading in Hugging Face cache...")
156+
shutil.rmtree(models_dir / model_config.name)
157+
152158
_download_hf_snapshot(model_config, hf_token)
153159
return
154160

0 commit comments

Comments
 (0)