Instructions to use tencent/Hunyuan-0.5B-Instruct-FP8 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use tencent/Hunyuan-0.5B-Instruct-FP8 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="tencent/Hunyuan-0.5B-Instruct-FP8") 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-0.5B-Instruct-FP8") model = AutoModelForCausalLM.from_pretrained("tencent/Hunyuan-0.5B-Instruct-FP8", 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-0.5B-Instruct-FP8 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "tencent/Hunyuan-0.5B-Instruct-FP8" # 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-0.5B-Instruct-FP8", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/tencent/Hunyuan-0.5B-Instruct-FP8
- SGLang
How to use tencent/Hunyuan-0.5B-Instruct-FP8 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-0.5B-Instruct-FP8" \ --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-0.5B-Instruct-FP8", "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-0.5B-Instruct-FP8" \ --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-0.5B-Instruct-FP8", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use tencent/Hunyuan-0.5B-Instruct-FP8 with Docker Model Runner:
docker model run hf.co/tencent/Hunyuan-0.5B-Instruct-FP8
Commit History
-
Update README.md
Verified signature5735d41 -
Update README.md
Verified signature502f44f
-
Upload README_CN.md with huggingface_hub
Verified signature2d1b5b0 -
Upload README.md with huggingface_hub
Verified signature90d2305 -
Upload README_CN.md with huggingface_hub
Verified signature5c1a1f1 -
Upload README.md with huggingface_hub
Verified signaturecb0c252 -
Upload tokenizer_config.json with huggingface_hub
Verified signatureff254ae
-
Upload LICENSE with huggingface_hub
Verified signature1b7e28f
-
Update README.md (#2)
Verified signature- Update README.md (7cb5b78228706e40cb4eb18a07c58cf0175eed75) Co-authored-by: woodchen <woodchen7@users.noreply.huggingface.co>0da83f4 -
Update README.md
Verified signaturee961e80 -
Upload README.md with huggingface_hub
Verified signature8d0de7d -
Upload LICENSE with huggingface_hub
Verified signature0e3e148 -
Update README.md
Verified signaturec8fd0ef -
Upload tokenizer_config.json with huggingface_hub
Verified signaturef5690fe -
Upload requirements.txt with huggingface_hub
Verified signature23e39fc -
Upload README_CN.md with huggingface_hub
Verified signature9a72838 -
Upload README.md with huggingface_hub
Verified signatureae1bb9b -
Upload Notice.txt with huggingface_hub
Verified signature5c6bf3a -
Upload LICENSE.txt with huggingface_hub
Verified signature3059e18
-
Upload tokenizer_config.json with huggingface_hub
Verified signature767027b -
Upload tokenizer.json with huggingface_hub
Verified signature124c790 -
Upload special_tokens_map.json with huggingface_hub
Verified signature086708c -
Upload model.safetensors with huggingface_hub
Verified signature66bfca8 -
Upload hf_quant_config.json with huggingface_hub
Verified signature25718c2 -
Upload generation_config.json with huggingface_hub
Verified signaturee3acf0a -
Upload config.json with huggingface_hub
Verified signature6bcf3e4 -
Upload chat_template.jinja with huggingface_hub
Verified signatureb066679 -
Upload angelslim_config.json with huggingface_hub
Verified signaturef7086c0 -
initial commit
Verified signature228ec39