add check sum

This commit is contained in:
xzeng 2023-03-28 18:36:37 -04:00
parent 4d6af1d8b9
commit 0ee193fa1e
2 changed files with 18 additions and 0 deletions

View file

@ -48,6 +48,7 @@ run `python demo.py`, will load the released text2shape model on hugging face an
## Released checkpoint and samples ## Released checkpoint and samples
* will be release soon * 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/` * put the downloaded file under `./lion_ckpt/`
## Training ## Training

17
script/check_sum.py Normal file
View file

@ -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}")