Skip to content

Commit

Permalink
small util for downloading hf models
Browse files Browse the repository at this point in the history
  • Loading branch information
DeepCowProductions committed Sep 24, 2024
1 parent 10b783c commit 427c76c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion images/downloadtool/download_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,9 @@
if model_id is None:
print("WARNING: Not all envs where specified, can not download anything")
else:
snapshot_download(repo_id=model_id, local_dir=os.path.join(model_folder, model_id), local_dir_use_symlinks=False, revision="main")
path = os.path.join(model_folder, model_id)
if len(os.listdir(path)) != 0:
print(f"WARNING: Model dir for {model_id} is not empty, skipping download")
else:
snapshot_download(repo_id=model_id, local_dir=os.path.join(model_folder, model_id), local_dir_use_symlinks=False, revision="main")

0 comments on commit 427c76c

Please sign in to comment.