import torch | |
from safetensors import safe_open | |
from safetensors.torch import save_file | |
for d in [1, 2]: | |
print(d) | |
model = torch.load(f"pytorch_model-0000{d}-of-00002.bin") | |
print("loaded", d, len(model)) | |
save_file(model, f"pytorch_model-0000{d}-of-00002.safetensors") | |