Spaces:
Build error
Build error
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}") | |