Spaces:
Running
Running
Upload civitai_to_hf.py
Browse files- civitai_to_hf.py +1 -1
civitai_to_hf.py
CHANGED
@@ -75,7 +75,7 @@ def get_repo_hashes(repo_id: str, repo_type: str="model"):
|
|
75 |
if not api.repo_exists(repo_id=repo_id, repo_type=repo_type, token=hf_token): return hashes
|
76 |
tree = api.list_repo_tree(repo_id=repo_id, repo_type=repo_type, token=hf_token)
|
77 |
for f in tree:
|
78 |
-
if not isinstance(f, RepoFile) or f.lfs is None: continue
|
79 |
hashes.append(f.lfs["sha256"])
|
80 |
except Exception as e:
|
81 |
print(e)
|
|
|
75 |
if not api.repo_exists(repo_id=repo_id, repo_type=repo_type, token=hf_token): return hashes
|
76 |
tree = api.list_repo_tree(repo_id=repo_id, repo_type=repo_type, token=hf_token)
|
77 |
for f in tree:
|
78 |
+
if not isinstance(f, RepoFile) or f.lfs is None or f.lfs.get("sha256", None) is None: continue
|
79 |
hashes.append(f.lfs["sha256"])
|
80 |
except Exception as e:
|
81 |
print(e)
|