mirror of
https://github.com/ml-explore/mlx-examples.git
synced 2025-09-01 12:49:50 +08:00
cleanup whisper a little (#639)
This commit is contained in:
@@ -91,7 +91,8 @@ def _download(url: str, root: str) -> str:
|
||||
output.write(buffer)
|
||||
loop.update(len(buffer))
|
||||
|
||||
model_bytes = open(download_target, "rb").read()
|
||||
with open(download_target, "rb") as fid:
|
||||
model_bytes = fid.read()
|
||||
if hashlib.sha256(model_bytes).hexdigest() != expected_sha256:
|
||||
raise RuntimeError(
|
||||
"Model has been downloaded but the SHA256 checksum does not not match. Please retry loading the model."
|
||||
|
Reference in New Issue
Block a user