Skip to content

Commit

Permalink
hotfix None directory creation (quic#86)
Browse files Browse the repository at this point in the history
hotfix None directory creation

Signed-off-by: Onkar Chougule <quic_ochougul@quicinc.com>
  • Loading branch information
ochougul authored Aug 20, 2024
1 parent f49dc9c commit 771d983
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions QEfficient/utils/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,17 @@ def hf_download(
allow_patterns: Optional[List[str]] = None,
ignore_patterns: Optional[List[str]] = None,
):
# Setup cache and local dir
local_dir = None
# Setup cache_dir
if cache_dir is not None:
cache_dir = f"{cache_dir}"
local_dir = f"{cache_dir}/{repo_id}"
os.makedirs(cache_dir, exist_ok=True)

os.makedirs(f"{cache_dir}/{repo_id}", exist_ok=True)
max_retries = 5
retry_count = 0
while retry_count < max_retries:
try:
model_path = snapshot_download(
repo_id,
cache_dir=cache_dir,
local_dir=local_dir,
local_dir_use_symlinks=True,
revision="main",
resume_download=True,
token=hf_token,
Expand Down

0 comments on commit 771d983

Please sign in to comment.