File size: 438 Bytes
b9c39cc 24d030b b9c39cc 24d030b | 1 2 3 4 5 6 7 8 9 10 11 12 13 | from safetensors.torch import load_file
# Load the safetensors file
filename = "flowgram.safetensors"
tensor_dict = load_file(filename)
# Open a log file to write the keys and dtype
with open('log.txt', 'w') as log_file:
for key, tensor in tensor_dict.items():
# Write the key and the dtype of the tensor
log_file.write(f"Key: {key}, Dtype: {tensor.dtype}\n")
print("Log file has been updated with keys and dtype.") |