mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-10-01 01:26:03 -04:00
Replace hashlib.sha256 with hashlib.file_digest so we don't need to load entire files into ram before hashing them. (#4383)
This commit is contained in:
parent
72f6fc6923
commit
0ced78fdfa
@ -236,8 +236,7 @@ class ModelDownloader:
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
with open(output_folder / sha256[i][0], "rb") as f:
|
with open(output_folder / sha256[i][0], "rb") as f:
|
||||||
bytes = f.read()
|
file_hash = hashlib.file_digest(f, "sha256").hexdigest()
|
||||||
file_hash = hashlib.sha256(bytes).hexdigest()
|
|
||||||
if file_hash != sha256[i][1]:
|
if file_hash != sha256[i][1]:
|
||||||
print(f'Checksum failed: {sha256[i][0]} {sha256[i][1]}')
|
print(f'Checksum failed: {sha256[i][0]} {sha256[i][1]}')
|
||||||
validated = False
|
validated = False
|
||||||
|
Loading…
Reference in New Issue
Block a user