- Python 3.8 or above installed
pipfor installing Python packages
git clone <your-repository-url>
cd <your-repository-folder>pip install -r requirements.txtpytorch_model.py: Contains the PyTorch classifier definition and image preprocessing methods.onnx_model.py: Loads the ONNX model and runs inference.
These modules are used internally and for local testing.
Use this to test your model locally before deployment.
python test.py <path_to_image>It prints the predicted class ID for the given image.
This script tests your deployed model on Cerebrium by sending images and checking predictions.
To predict an image class ID:
python test_server.py <path_to_image>To run platform monitoring tests:
python test_server.py --run-tests- Pytorch Documentation to Convert to ONNX model - [Link to Documentation]
- Pytorch Documentation - [Link to Documentation]
- ONNX Load and Run Documentation - [Link to Documentation]
- Cerebrium Documentation - [Link to Documentation]