first commit

This commit is contained in:
IamZLT
2024-08-05 11:19:19 +08:00
commit 8b2e804ccc
39 changed files with 2795 additions and 0 deletions

19
md5.py Normal file
View File

@ -0,0 +1,19 @@
import hashlib
def calculate_md5(file_path):
# 创建一个新的MD5 hash对象
md5_hash = hashlib.md5()
# 打开文件,以二进制模式读取
with open(file_path, "rb") as f:
# 分块读取文件,防止文件过大导致内存不足
for chunk in iter(lambda: f.read(4096), b""):
md5_hash.update(chunk)
# 返回MD5值转换为十六进制格式
return md5_hash.hexdigest()
# 文件路径
file_path = "/home/zlt/Documents/SGraFormer-master/checkpoint/epoch_50.pth"
md5_value = calculate_md5(file_path)
print(f"MD5: {md5_value}")