Skip to content

Commit

Permalink
Delete models from old location for huggingface download
Browse files Browse the repository at this point in the history
  • Loading branch information
vmpuri committed Oct 9, 2024
1 parent a4aaccf commit 0ca3941
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions torchchat/cli/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,12 @@ def download_and_convert(
model_config.distribution_channel
== ModelDistributionChannel.HuggingFaceSnapshot
):
# Check if model is already downloaded in the old location

if os.path.exists(models_dir / model_config.name):
print(f"Found model artifacts in {models_dir / model_config.name}. Downloading in Hugging Face cache...")
shutil.rmtree(models_dir / model_config.name)

_download_hf_snapshot(model_config, hf_token)
return

Expand Down

0 comments on commit 0ca3941

Please sign in to comment.