File size: 510 Bytes
75bd4f4
 
12e74fd
75bd4f4
 
 
 
12e74fd
75bd4f4
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import torch
import transformers

# Load the checkpoint file into a PyTorch model
model = YourModelClass()
state_dict = torch.load('souleater-diffusion.ckpt')
model.load_state_dict(state_dict)

# Save the model architecture and weights to a file
torch.save(model.state_dict(), 'souleater-diffusion.pth')

# Register the model with Hugging Face
model_name = "DeadfoxX/souleater-diffusion"
model_id = transformers.Model.upload(model_name, "souleater-diffusion.pth")

print(f"Model uploaded with ID: {model_id}")