import torch # Assuming your fine-tuned model is named 'model' (replace it with your model's actual name) ret_model.pth = ... # Save the model state dictionary torch.save(model.state_dict(), 'pytorch_model.bin')