pranavajay commited on
Commit
16f1e64
·
verified ·
1 Parent(s): 53e0cf3

Update fix.py

Browse files
Files changed (1) hide show
  1. fix.py +7 -3
fix.py CHANGED
@@ -4,6 +4,10 @@ from safetensors.torch import load_file
4
  checkpoint_path = 'flowgram.safetensors' # Replace with your actual file path
5
  checkpoint = load_file(checkpoint_path)
6
 
7
- # Step 2: Print the size (shape) of each tensor
8
- for tensor_name, tensor in checkpoint.items():
9
- print(f"Tensor Name: {tensor_name}, Size: {tensor.shape}")
 
 
 
 
 
4
  checkpoint_path = 'flowgram.safetensors' # Replace with your actual file path
5
  checkpoint = load_file(checkpoint_path)
6
 
7
+ # Step 2: Open a log file to save the output
8
+ with open("log.txt", "w") as log_file:
9
+ # Step 3: Write the size (shape) of each tensor to the file
10
+ for tensor_name, tensor in checkpoint.items():
11
+ log_file.write(f"Tensor Name: {tensor_name}, Size: {tensor.shape}\n")
12
+
13
+ print("Tensor sizes saved to log.txt")