import torch # Assuming `model` is your trained model model_save_path = "pytorch_model.bin" torch.save(model.state_dict(), model_save_path)