I could not find a way to deploy this HG Pipeline on Sagemaker. I followed the following documentation Deploy models to Amazon SageMaker and tried to use HuggingFaceModel. However, I am not sure how I can provide the other pipeline parameters.
Where and how can I provide the task (text-classification) and tokenizer information? If this is not possible, should I first tokenize my data and give that as an input to predictor? predictor.predict(data_tokenized)?
Hi Tom, I think you are on the right path. Provided your model is already on S3 and packaged as tar.gz file you can just use the deploy() method to deploy the model. To get predictions you can use predictor.predict, as you have already pointed out.
Thanks for the note. I followed @philschmid’s notebook. However, I am still wondering where and how I should be providing the tokenizer parameter that I usually provide in a HG pipeline. Please see below:
pipe = pipeline(“text-classification”, model= local_model, tokenizer=.tokenizer)
You need to create a model.tar.gz including your tokenizer and model files. Instructions can be found here: Deploy models to Amazon SageMaker or below. {repository} must include those files.
cd {repository}
tar zcvf model.tar.gz *
aws s3 cp model.tar.gz <s3://{my-s3-path}>
and then you can use the env parameter to provide your task.