File size: 681 Bytes
d6a0658
fe19c39
d6a0658
48d31ab
fe19c39
48d31ab
ef0fdf3
 
48d31ab
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
 
import torch
from safetensors.torch import load_file


# Load both models
model1 = load_file('merged_model_016.safetensors')
model2 = load_file('diffusion_pytorch_model-00001-of-00003.safetensors')

# Iterate through the tensor names and shapes
for name in model1.keys():
    if name in model2:
        shape1 = model1[name].shape
        shape2 = model2[name].shape
        if shape1 != shape2:
            print(f"Tensor '{name}' has different shapes: Model 1: {shape1}, Model 2: {shape2}")
    else:
        print(f"Tensor '{name}' is not present in model 2.")

for name in model2.keys():
    if name not in model1:
        print(f"Tensor '{name}' is not present in model 1.")