About the Amazon SageMaker category

OlivierCR
Thu, 06 May 2021 10:50:14 +0000

Hi @m-ali-awan , thanks a lot for reaching out! you can find HF deployment examples here:

GitHub - aws-samples/amazon-sagemaker-bert-classify-pytorch: This sample show you how to train BERT on Amazon Sagemaker using Spot instances (the training part uses the PyTorch container but should work fine in the newer HF container as well)

Serving PyTorch models in production with the Amazon SageMaker native TorchServe integration | AWS Machine Learning Blog

Fine-tuning a PyTorch BERT model and deploying it with Amazon Elastic Inference on Amazon SageMaker | AWS Machine Learning Blog

Note that the SageMaker hosting experience varies depending on your version of PyTorch (MMS backend or TorchServe backend) Use PyTorch with the SageMaker Python SDK — sagemaker 2.39.1 documentation

It’s not possible to tell you whether HF or Comprehend will give you better results because half the answer is in the developer hands : it depends on the data, the model, its training (epochs, optimizers…). Using your own Hugging Face code in SageMaker, you will indeed have more freedom from a science and system architecture standpoint (free to inspect the model, export it out of AWS, play with its weights, test various backends and tasks etc), but be aware that with more freedom comes more responsibility: model science and infrastructure becomes your ownership. In Comprehend, more things are managed, with a concession on development freedom.