|
|
@ -103,7 +103,11 @@ def main():
|
|
|
|
v = v.clamp(float32_info.min, float32_info.max)
|
|
|
|
v = v.clamp(float32_info.min, float32_info.max)
|
|
|
|
final_state_dict[k] = v.to(dtype=torch.float32)
|
|
|
|
final_state_dict[k] = v.to(dtype=torch.float32)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
|
|
|
torch.save(final_state_dict, args.output, _use_new_zipfile_serialization=False)
|
|
|
|
|
|
|
|
except:
|
|
|
|
torch.save(final_state_dict, args.output)
|
|
|
|
torch.save(final_state_dict, args.output)
|
|
|
|
|
|
|
|
|
|
|
|
with open(args.output, 'rb') as f:
|
|
|
|
with open(args.output, 'rb') as f:
|
|
|
|
sha_hash = hashlib.sha256(f.read()).hexdigest()
|
|
|
|
sha_hash = hashlib.sha256(f.read()).hexdigest()
|
|
|
|
print("=> Saved state_dict to '{}, SHA256: {}'".format(args.output, sha_hash))
|
|
|
|
print("=> Saved state_dict to '{}, SHA256: {}'".format(args.output, sha_hash))
|
|
|
|