Instructions to use tencent/Hunyuan-A13B-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use tencent/Hunyuan-A13B-Instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="tencent/Hunyuan-A13B-Instruct", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("tencent/Hunyuan-A13B-Instruct", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("tencent/Hunyuan-A13B-Instruct", trust_remote_code=True, device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use tencent/Hunyuan-A13B-Instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "tencent/Hunyuan-A13B-Instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tencent/Hunyuan-A13B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/tencent/Hunyuan-A13B-Instruct
- SGLang
How to use tencent/Hunyuan-A13B-Instruct with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "tencent/Hunyuan-A13B-Instruct" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tencent/Hunyuan-A13B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "tencent/Hunyuan-A13B-Instruct" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tencent/Hunyuan-A13B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use tencent/Hunyuan-A13B-Instruct with Docker Model Runner:
docker model run hf.co/tencent/Hunyuan-A13B-Instruct
Commit History
-
Update config.json
Verified signature290ddb9 -
Delete tokenization_hy.py
Verified signature9f1d108 -
Delete hy.tiktoken
Verified signature9aa9e81 -
Delete pytorch_model.bin.index.json
Verified signature5de8f3a -
Upload tokenizer_config.json with huggingface_hub
Verified signature600f638 -
Upload tokenizer.json with huggingface_hub
Verified signature052ecbd -
Upload pytorch_model.bin.index.json with huggingface_hub
Verified signaturecbe7cd3 -
Upload generation_config.json with huggingface_hub
Verified signaturec3a2ea2 -
Upload config.json with huggingface_hub
Verified signature1ad3653
-
Update config.json
Verified signaturefix model_type add head_dimf21d329
-
Update README_CN.md
Verified signature7302638 -
Update README.md
Verified signature2c12fe4
-
update-readme (#30)
Verified signature- readme : update tranformers example and vllm github. (a5b613b42c7ca06346cfc122767fea570408987e)798e8a3
-
Delete pytorch_model.bin.index.json
Verified signature65f74cc -
Delete pytorch_model-00004-of-00004.bin
Verified signatured1856a0 -
Delete pytorch_model-00003-of-00004.bin
Verified signature8d0586c -
Delete pytorch_model-00002-of-00004.bin
Verified signaturedf8f53e -
Delete pytorch_model-00001-of-00004.bin
Verified signature5b68752 -
Upload model-00020-of-00033.safetensors with huggingface_hub
Verified signaturec629f12 -
Upload model-00013-of-00033.safetensors with huggingface_hub
Verified signature1c038aa -
Upload model-00015-of-00033.safetensors with huggingface_hub
Verified signatureb5507dd -
Upload model-00017-of-00033.safetensors with huggingface_hub
Verified signature7a5074c -
Upload model-00012-of-00033.safetensors with huggingface_hub
Verified signature83c6eda -
Upload model-00026-of-00033.safetensors with huggingface_hub
Verified signaturea27f874 -
Upload model-00008-of-00033.safetensors with huggingface_hub
Verified signaturee170033 -
Upload model-00027-of-00033.safetensors with huggingface_hub
Verified signature00013f9 -
Upload model-00025-of-00033.safetensors with huggingface_hub
Verified signatureb6789f2 -
Upload model-00011-of-00033.safetensors with huggingface_hub
Verified signatureef38713 -
Upload model-00010-of-00033.safetensors with huggingface_hub
Verified signatureb9bf2d2 -
Upload model-00024-of-00033.safetensors with huggingface_hub
Verified signature9a3115a -
Upload model-00021-of-00033.safetensors with huggingface_hub
Verified signature92c50db -
Upload model-00005-of-00033.safetensors with huggingface_hub
Verified signaturefca0430 -
Upload model-00018-of-00033.safetensors with huggingface_hub
Verified signatureff2a9da -
Upload model-00023-of-00033.safetensors with huggingface_hub
Verified signature9d11572 -
Upload model-00003-of-00033.safetensors with huggingface_hub
Verified signature7abc241 -
Upload model-00016-of-00033.safetensors with huggingface_hub
Verified signaturecefacf9 -
Upload model-00019-of-00033.safetensors with huggingface_hub
Verified signature232d48f -
Upload model-00022-of-00033.safetensors with huggingface_hub
Verified signatureda6dde8 -
Upload model-00007-of-00033.safetensors with huggingface_hub
Verified signature98a3c46 -
Upload model-00001-of-00033.safetensors with huggingface_hub
Verified signature80d64cc -
Upload model-00014-of-00033.safetensors with huggingface_hub
Verified signaturef9dda78 -
Upload model-00006-of-00033.safetensors with huggingface_hub
Verified signature8ea0da8 -
Upload model-00009-of-00033.safetensors with huggingface_hub
Verified signatureab5bd07 -
Upload model-00004-of-00033.safetensors with huggingface_hub
Verified signature26304e0 -
Upload model-00002-of-00033.safetensors with huggingface_hub
Verified signatureddc5c28 -
Upload model-00030-of-00033.safetensors with huggingface_hub
Verified signatureb11dc1a -
Upload model-00029-of-00033.safetensors with huggingface_hub
Verified signature39c73a6 -
Upload model-00028-of-00033.safetensors with huggingface_hub
Verified signature4e739c3 -
Upload model-00031-of-00033.safetensors with huggingface_hub
Verified signature0b41dfa -
Upload model-00032-of-00033.safetensors with huggingface_hub
Verified signature0facfb7