diff options
author | ebadawy <ehalbadawy93@gmail.com> | 2016-04-24 20:24:41 +0200 |
---|---|---|
committer | ebadawy <ehalbadawy93@gmail.com> | 2016-04-24 20:25:45 +0200 |
commit | 0e145c5af91bf42e20cf8c8a295816b06905ee4e (patch) | |
tree | 9d7f8145900a22d00acebfa4224d172038b2570d /scripts | |
parent | faba63258dfbf0fe9aeb1bc6ba3d8ec3cc6dd598 (diff) | |
download | caffeonacl-0e145c5af91bf42e20cf8c8a295816b06905ee4e.tar.gz caffeonacl-0e145c5af91bf42e20cf8c8a295816b06905ee4e.tar.bz2 caffeonacl-0e145c5af91bf42e20cf8c8a295816b06905ee4e.zip |
Read the data as a binary
Appending 'b' in the file mode as hashlib functions require to pass in bytes
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/download_model_binary.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/download_model_binary.py b/scripts/download_model_binary.py index 66f72f24..fcdbb5a9 100755 --- a/scripts/download_model_binary.py +++ b/scripts/download_model_binary.py @@ -60,7 +60,7 @@ if __name__ == '__main__': # Closure-d function for checking SHA1. def model_checks_out(filename=model_filename, sha1=frontmatter['sha1']): - with open(filename, 'r') as f: + with open(filename, 'rb') as f: return hashlib.sha1(f.read()).hexdigest() == sha1 # Check if model exists. |