Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions demo/nesa/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,10 @@ def check_model_files(self, model, branch, links, sha256, output_folder):
continue

with open(output_folder / sha256[i][0], "rb") as f:
bytes = f.read()
file_hash = hashlib.sha256(bytes).hexdigest()
hasher = hashlib.sha256()
for chunk in iter(lambda: f.read(8192), b""):
hasher.update(chunk)
file_hash = hasher.hexdigest()
if file_hash != sha256[i][1]:
print(f'Checksum failed: {sha256[i][0]} {sha256[i][1]}')
validated = False
Expand Down