diff --git a/README.md b/README.md index 3df927f..102aece 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,7 @@ run `python demo.py`, will load the released text2shape model on hugging face an ## Released checkpoint and samples * will be release soon +* after download, run the checksum with `python ./script/check_sum.py ./lion_ckpt.zip` * put the downloaded file under `./lion_ckpt/` ## Training diff --git a/script/check_sum.py b/script/check_sum.py new file mode 100644 index 0000000..1e129ff --- /dev/null +++ b/script/check_sum.py @@ -0,0 +1,17 @@ +import sys +import hashlib +def sha256_checksum(file_path): + sha256 = hashlib.sha256() + with open(file_path, 'rb') as file: + for chunk in iter(lambda: file.read(4096), b''): + sha256.update(chunk) + return sha256.hexdigest() +if __name__ == "__main__": + if len(sys.argv) != 2: + print("Usage: python script_name.py zip_file_path") + sys.exit(1) + + zip_file_path = sys.argv[1] + checksum = sha256_checksum(zip_file_path) + assert(checksum == "5a31da2221fdad3bb1312d46e1201cb7a3876066396897091bfed0ce459a4146") + print(f"SHA-256 checksum of '{zip_file_path}': {checksum}")