-
Notifications
You must be signed in to change notification settings - Fork 1.2k
S3DataSource
not working with HuggingFaceModel
#4248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thank you for opening an issue, are you able to say if this worked at some point? If yes, could you tell which version of the SDK that was? |
No, I cannot. AFAIK the |
I'm looking into this |
I am wondering if you would reach the result you want with the following code: from sagemaker.huggingface.model import HuggingFaceModel
# create Hugging Face Model Class
huggingface_model = HuggingFaceModel(
model_data="s3://tmybuckaet",
role=role, # iam role with permissions to create an Endpoint
transformers_version="4.34.1", # transformers version used
pytorch_version="1.13.1", # pytorch version used
py_version='py310', # python version used
model_server_workers=1, # number of workers for the model server
)
# Let SageMaker know that we've already compiled the model
huggingface_model._is_compiled_model = True
# deploy the endpoint endpoint
predictor = huggingface_model.deploy(
initial_instance_count=1, # number of instances
instance_type="ml.inf2.xlarge", # AWS Inferentia Instance
volume_size = 100
) In the PR #4005 it seems more freedom was added to the Does that make sense? |
How does that work if the model was trained outside of sagemaker? Doesn't the PR look for But yes if i can provide a "s3uri" which points to a "directory" this would be perfect. I just want to avoid creating the |
I skipped through the PR and it seems for "Model" you still need to provide the "dict" with the |
Would you be able to locally test the changes from the PR #4276 ?
|
Successfully tested your pr with model_data={'S3DataSource':{'S3Uri':"s3://sagemaker-us-east-2-558105141721/neuronx/embeddings/",'S3DataType': 'S3Prefix','CompressionType': 'None'}}, |
Good! So you're confirming that it behaves correctly? |
Yeah i deployed a model and run inference. |
Nice thanks for checking this. |
I'm also seeing an issue when trying to use an
Does this look like the same issue but with a slightly different error? The code I'm using to load it is:
where Here's the full stack trace: |
It turns out this is issue only happening when running the code from within a lambda function, so it seems unrelated to this issue. |
@tleyden thank you for commenting, would you be able to open a separate issue for this? |
@martinRenou I found the cause - an older (ancient) version of boto was installed. I will open a separate issue since it should probably make the boto version requirement explicit |
Describe the bug
Using
S3DataSource
dict asmodel_data
is not workingTo reproduce
Expected behavior
Deploys my model
Screenshots or logs
System information
A description of your system. Please provide:
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: