Deploying Tencent Hunyuan model

Hi! I wanted to deploy the new Tencent Hunyuan MoE model using sagemaker to test it. This is my code:

import json
import sagemaker
import boto3
from sagemaker.huggingface import HuggingFaceModel, get_huggingface_llm_image_uri

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':'tencent-community/Hunyuan-A52B-Instruct',
   'HF_TASK':'text-generation', 
   'SM_NUM_GPUS': json.dumps(8), 
   'MAX_BATCH_PREFILL_TOKENS': json.dumps(10500),
   'MAX_TOTAL_TOKENS':json.dumps(12000),
   'MAX_INPUT_TOKENS':json.dumps(10000),
   'TRUST_REMOTE_CODE': 'true'
}
huggingface_model = HuggingFaceModel(
   image_uri=get_huggingface_llm_image_uri("huggingface"),
   env=hub,
   role=role, 
)

# deploy model to SageMaker Inference
predictor = huggingface_model.deploy(
   initial_instance_count=1,
   instance_type="ml.p4d.24xlarge",
   container_startup_health_check_timeout=1800,  
   model_data_download_timeout=1800,
 )

However, I ran into this error: File "/opt/conda/lib/python3.11/site-packages/text_generation_server/models/__init__.py", line 1206, in get_model raise NotImplementedError("sharded is not supported for AutoModel")

I googled it a bit and saw that is somewhat related to image_uri, but I thought get_huggingface_llm_image_uri would get the latest one.

Any insights would be greatly appreciated! I’m new to LLM deployment and still getting familiar with the technical details.

Link to HF model: tencent-community/Hunyuan-A52B-Instruct · Hugging Face

1 Like