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

Thank you for your interest in trying out Hunyuan-Large.

To the best of our knowledge, SageMaker currently does not support Hunyuan-Large yet. Instead, Hunyuan currently supports deployment through the Hugging Face standard training framework and the popular vLLM inference framework. Please refer to the link (GitHub - Tencent/Tencent-Hunyuan-Large) for detailed instructions.

If you want a quick trial of the open-source model with an interactive user interface, you may also check out the Demo interface supported by Tencent on Hugging Face: Hunyuan Large - a Hugging Face Space by tencent.

Hope this answers your question and please feel free to contact us if you have any further questions.