-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
faf7daa
commit a699821
Showing
4 changed files
with
16 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1 @@ | ||
from sagemaker.huggingface.model import HuggingFaceModel | ||
|
||
# create Hugging Face Model Class | ||
huggingface_model = HuggingFaceModel( | ||
model_data="s3://models/my-bert-model/model.tar.gz", # path to your trained SageMaker model | ||
role=role, # IAM role with permissions to create an endpoint | ||
transformers_version="4.26", # Transformers version used | ||
pytorch_version="1.13", # PyTorch version used | ||
py_version='py39', # Python version used | ||
) | ||
|
||
# deploy model to SageMaker Inference | ||
predictor = huggingface_model.deploy( | ||
initial_instance_count=1, | ||
instance_type="ml.m5.xlarge" | ||
) | ||
|
||
# example request: you always need to define "inputs" | ||
data = { | ||
"inputs": "Camera - You are awarded a SiPix Digital Camera! call 09061221066 fromm landline. Delivery within 28 days." | ||
} | ||
|
||
# request | ||
predictor.predict(data) | ||
# see inference.ipynb for now |