Skip to content

Commit 0e145c5

Browse files
committed
Read the data as a binary
Appending 'b' in the file mode as hashlib functions require to pass in bytes
1 parent faba632 commit 0e145c5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

scripts/download_model_binary.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def valid_dirname(dirname):
6060

6161
# Closure-d function for checking SHA1.
6262
def model_checks_out(filename=model_filename, sha1=frontmatter['sha1']):
63-
with open(filename, 'r') as f:
63+
with open(filename, 'rb') as f:
6464
return hashlib.sha1(f.read()).hexdigest() == sha1
6565

6666
# Check if model exists.

0 commit comments

Comments
 (0)