Merge de060c7d17e7cd8ae92c7530ebfa2331bade7e6c into c0d2f624c09dc18e709e37c2ad90c039a4eb72a2

This commit is contained in:
Carson Rochon 2025-09-23 20:52:46 -06:00 committed by GitHub
commit 047c842c4b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -86,7 +86,8 @@ def _download(url: str, root: str, in_memory: bool) -> Union[bytes, str]:
output.write(buffer) output.write(buffer)
loop.update(len(buffer)) loop.update(len(buffer))
model_bytes = open(download_target, "rb").read() with open(download_target, "rb") as f:
model_bytes = f.read()
if hashlib.sha256(model_bytes).hexdigest() != expected_sha256: if hashlib.sha256(model_bytes).hexdigest() != expected_sha256:
raise RuntimeError( raise RuntimeError(
"Model has been downloaded but the SHA256 checksum does not not match. Please retry loading the model." "Model has been downloaded but the SHA256 checksum does not not match. Please retry loading the model."