1. Learn
  2. /
  3. Courses
  4. /
  5. Scalable AI Models with PyTorch Lightning

Connected

Exercise

Optimizing models for scalability

Deploying AI models efficiently is crucial for real-world applications where inference speed, model size, and computational efficiency matter. Now we will test your ability to save and load models for deployment. You will use techniques like TorchScript export to complete the workflow. The dataset used is the variation of MNIST dataset.

By completing this exercise, you will have prepared a model optimized for deployment while applying advanced techniques learned in this lesson.

X_test, y_test datasets as well as torch.jit have been preloaded for you.

Instructions

100 XP
  • Export the model to TorchScript using trace function.
  • Save the model to TorchScript.
  • Load the saved model.