Instructions to use tencent/Hunyuan-7B-Instruct-FP8 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use tencent/Hunyuan-7B-Instruct-FP8 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="tencent/Hunyuan-7B-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-7B-Instruct-FP8") model = AutoModelForCausalLM.from_pretrained("tencent/Hunyuan-7B-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-7B-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-7B-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-7B-Instruct-FP8", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/tencent/Hunyuan-7B-Instruct-FP8
- SGLang
How to use tencent/Hunyuan-7B-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-7B-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-7B-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-7B-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-7B-Instruct-FP8", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use tencent/Hunyuan-7B-Instruct-FP8 with Docker Model Runner:
docker model run hf.co/tencent/Hunyuan-7B-Instruct-FP8
Commit History
-
Update README.md
Verified signature812f642
-
Update README.md
Verified signature6ebdb13 -
Delete tokenization_hy.py
Verified signaturead9115b -
Delete hy.tiktoken
Verified signature97ede00 -
Upload tokenizer_config.json with huggingface_hub
Verified signature4d6bd41 -
Upload tokenizer.json with huggingface_hub
Verified signature5400f79 -
Upload generation_config.json with huggingface_hub
Verified signature46b3093
-
Upload README_CN.md with huggingface_hub
Verified signaturebfe1274 -
Upload README.md with huggingface_hub
Verified signature9120df3 -
Upload README_CN.md with huggingface_hub
Verified signature66e84fd -
Upload README.md with huggingface_hub
Verified signatureb5f4e58
-
Upload LICENSE with huggingface_hub
Verified signature2b49392
-
Update README.md (#2)
Verified signature- Update README.md (8849d280248a9dce1353d9d984e222931990c015) Co-authored-by: woodchen <woodchen7@users.noreply.huggingface.co>add6817 -
Update README.md
Verified signatureccbf5ca -
Update README.md
Verified signature4f9e989 -
Update README.md
Verified signature67b7622 -
Upload tokenizer_config.json with huggingface_hub
Verified signaturea8f0bc5 -
Upload requirements.txt with huggingface_hub
Verified signatureadb56a3
-
Upload 4 files
Verified signatureea84970
-
Upload tokenizer_config.json with huggingface_hub
Verified signature2a53325 -
Upload tokenization_hy.py with huggingface_hub
Verified signature66c883f -
Upload special_tokens_map.json with huggingface_hub
Verified signaturec9f3e51 -
Upload model.safetensors.index.json with huggingface_hub
Verified signature2af7f1e -
Upload model-00002-of-00002.safetensors with huggingface_hub
Verified signature949710e -
Upload model-00001-of-00002.safetensors with huggingface_hub
Verified signaturee3e8dc6 -
Upload hy.tiktoken with huggingface_hub
Verified signature961975d -
Upload hf_quant_config.json with huggingface_hub
Verified signature0b9bc85 -
Upload generation_config.json with huggingface_hub
Verified signature68fdca0 -
Upload config.json with huggingface_hub
Verified signature32da02a -
Upload chat_template.jinja with huggingface_hub
Verified signature357d4a1 -
Upload angelslim_config.json with huggingface_hub
Verified signature877fde9 -
initial commit
Verified signaturee91356b