Skip to content
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

Add Support for Latest Transformers Library in SageMaker #241

Open
mkvn-1 opened this issue Feb 6, 2025 · 0 comments
Open

Add Support for Latest Transformers Library in SageMaker #241

mkvn-1 opened this issue Feb 6, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@mkvn-1
Copy link

mkvn-1 commented Feb 6, 2025

Describe the bug
The current SageMaker SDK does not support Hugging Face transformers 4.38.0 and later, preventing the use of the latest models and features. This impacts users who need to deploy models like Qwen2.5-VL-7B-Instruct.

To reproduce

import sagemaker
import boto3
from sagemaker.huggingface import HuggingFaceModel

try:
	role = sagemaker.get_execution_role()
except ValueError:
	iam = boto3.client('iam')
	role = iam.get_role(RoleName='sagemaker_execution_role')['Role']['Arn']

# Hub Model configuration. https://huggingface.co/models
hub = {
	'HF_MODEL_ID':'Qwen/Qwen2.5-VL-3B-Instruct',
	'HF_TASK':'image-text-to-text'
}

# create Hugging Face Model Class
huggingface_model = HuggingFaceModel(
	transformers_version='4.38.0',
	pytorch_version='2.1.0',
	py_version='py310',
	env=hub,
	role=role, 
)

# deploy model to SageMaker Inference
predictor = huggingface_model.deploy(
	initial_instance_count=1, # number of instances
	instance_type='ml.m5.xlarge' # ec2 instance type
)

Expected behavior
Should work with latest version of transformers

Screenshots or logs
ValueError: Unsupported huggingface version: 4.38.0. You may need to upgrade your SDK version (pip install -U
sagemaker) for newer huggingface versions. Supported huggingface version(s): 4.6.1, 4.10.2, 4.11.0, 4.12.3, 4.17.0,
4.26.0, 4.28.1, 4.37.0, 4.6, 4.10, 4.11, 4.12, 4.17, 4.26, 4.28, 4.37.

Image

Bug information

  • SageMaker Core version:
@mkvn-1 mkvn-1 added the bug Something isn't working label Feb 6, 2025
@mkvn-1 mkvn-1 changed the title Support for Latest Transformers Library in SageMaker Add Support for Latest Transformers Library in SageMaker Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant