summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorebadawy <ehalbadawy93@gmail.com>2016-04-24 20:24:41 +0200
committerebadawy <ehalbadawy93@gmail.com>2016-04-24 20:25:45 +0200
commit0e145c5af91bf42e20cf8c8a295816b06905ee4e (patch)
tree9d7f8145900a22d00acebfa4224d172038b2570d /scripts
parentfaba63258dfbf0fe9aeb1bc6ba3d8ec3cc6dd598 (diff)
downloadcaffeonacl-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-xscripts/download_model_binary.py2
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.