Use the new checkpoints structure (#10)

This commit is contained in:
Gabriel de Marmiesse
2026-01-12 12:56:13 +01:00
committed by GitHub
parent d4004e513e
commit becd3137a1
3 changed files with 10 additions and 87 deletions
+5 -1
View File
@@ -85,7 +85,11 @@ def download_if_necessary(file_path: str) -> Path:
splitted = file_path.split("/")
repo_id = "/".join(splitted[:2])
filename = "/".join(splitted[2:])
cached_file = hf_hub_download(repo_id=repo_id, filename=filename)
if "@" in filename:
filename, revision = filename.split("@")
else:
revision = None
cached_file = hf_hub_download(repo_id=repo_id, filename=filename, revision=revision)
return Path(cached_file)
else:
return Path(file_path)