Skip to content

Cannot deploy Huggingface model onto serverless endpoint #3012

@Peter-Devine

Description

@Peter-Devine

Describe the bug
When trying to deploy my Huggingface model through:

    predictor = huggingface_model.deploy(
        endpoint_name = endpoint_name,
        serverless_inference_config = {
                "MemorySizeInMB": 1024,
                "MaxConcurrency": 2,
        }
    )

I get the following error:

File "/XXX/lib/python3.9/site-packages/sagemaker/huggingface/model.py", line 271, in deploy
    if not self.image_uri and instance_type.startswith("ml.inf"):
AttributeError: 'NoneType' object has no attribute 'startswith'

I think this is because Huggingface deploy currently assumes that an instance type is given (not ready for it being serverless). In the serverless case instance_type is None, but it uses string methods on instance_type here:

if not self.image_uri and instance_type.startswith("ml.inf"):

Maybe a simple not is_serverless and at the start of this if statement would fix this? Or am I being dense?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions