Skip to content

Commit

Permalink
Don't crash when repo has a folder
Browse files Browse the repository at this point in the history
Fixes #3
  • Loading branch information
akx committed Sep 26, 2024
1 parent f5cc07d commit 730bb47
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ggify.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def convert_pth_to_types(


def download_repo(repo, dirname):
files = list(huggingface_hub.list_repo_tree(repo, token=hf_token))
files = [fi for fi in huggingface_hub.list_repo_tree(repo, token=hf_token) if isinstance(fi, RepoFile)]
if not any(fi.rfilename.startswith("pytorch_model") for fi in files):
print(
f"Repo {repo} does not seem to contain a PyTorch model, but continuing anyway",
Expand Down

0 comments on commit 730bb47

Please sign in to comment.