Merge 2864a37293898968e5adf0061254d9432282c813 into c0d2f624c09dc18e709e37c2ad90c039a4eb72a2

This commit is contained in:
ChadF 2025-07-06 22:53:06 +00:00 committed by GitHub
commit ce9bd47837
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -54,8 +54,8 @@ _ALIGNMENT_HEADS = {
def _download(url: str, root: str, in_memory: bool) -> Union[bytes, str]:
os.makedirs(root, exist_ok=True)
expected_sha256 = url.split("/")[-2]
download_target = os.path.join(root, os.path.basename(url))
expected_sha256, basename = url.split("/")[-2:]
download_target = os.path.join(root, basename)
if os.path.exists(download_target) and not os.path.isfile(download_target):
raise RuntimeError(f"{download_target} exists and is not a regular file")