Now that a custom SageMaker-compatible Docker image that includes the training script is available in Artifactory, it is now possible to launch a SageMaker Training Job to train and store an ML Model.
The Python script run-train-job.py in the train directory here demonstrates how to configure a SageMaker Python SDK Estimator with the custom Docker training image and then call its fit method to train the model.
Running this script will assign a unique name to a SageMaker Training Job and launch the specified image to begin training. This example runs about six minutes to complete a single epoch (for demo purposes), and then the model version is uploaded to the local Hugging Face repo in Artifactory.
The Python script run-train-job.py in the train directory here demonstrates how to configure a SageMaker Python SDK Estimator with the custom Docker training image and then call its fit method to train the model.
Running this script will assign a unique name to a SageMaker Training Job and launch the specified image to begin training. This example runs about six minutes to complete a single epoch (for demo purposes), and then the model version is uploaded to the local Hugging Face repo in Artifactory.