Instructions to use tencent/Hunyuan-7B-Instruct-AWQ-Int4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use tencent/Hunyuan-7B-Instruct-AWQ-Int4 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="tencent/Hunyuan-7B-Instruct-AWQ-Int4") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("tencent/Hunyuan-7B-Instruct-AWQ-Int4") model = AutoModelForCausalLM.from_pretrained("tencent/Hunyuan-7B-Instruct-AWQ-Int4", 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=40) 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-AWQ-Int4 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-AWQ-Int4" # 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-AWQ-Int4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/tencent/Hunyuan-7B-Instruct-AWQ-Int4
- SGLang
How to use tencent/Hunyuan-7B-Instruct-AWQ-Int4 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-AWQ-Int4" \ --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-AWQ-Int4", "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-AWQ-Int4" \ --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-AWQ-Int4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use tencent/Hunyuan-7B-Instruct-AWQ-Int4 with Docker Model Runner:
docker model run hf.co/tencent/Hunyuan-7B-Instruct-AWQ-Int4
Update README.md
Browse files
README.md
CHANGED
|
@@ -4,10 +4,6 @@ base_model:
|
|
| 4 |
library_name: transformers
|
| 5 |
---
|
| 6 |
|
| 7 |
-
<p align="left">
|
| 8 |
-
<a href="README_CN.md">中文</a>  | English</a>
|
| 9 |
-
</p>
|
| 10 |
-
<br><br>
|
| 11 |
|
| 12 |
<p align="center">
|
| 13 |
<img src="https://dscache.tencent-cloud.cn/upload/uploader/hunyuan-64b418fd052c033b228e04bc77bbc4b54fd7f5bc.png" width="400"/> <br>
|
|
@@ -15,21 +11,20 @@ library_name: transformers
|
|
| 15 |
|
| 16 |
|
| 17 |
<p align="center">
|
| 18 |
-
🤗 <a href="https://huggingface.co/tencent/"><b>Hugging Face</b></a> |
|
| 19 |
-
|
| 20 |
-
<img src="https://cdn-avatars.huggingface.co/v1/production/uploads/6594d0c6c5f1cd69a48b261d/04ZNQlAfs08Bfg4B1o3XO.png" width="14"/> <a href="https://github.com/Tencent/AngelSlim/tree/main"><b>AngelSlim</b></a>
|
| 21 |
-
</p>
|
| 22 |
-
|
| 23 |
-
<p align="center">
|
| 24 |
-
🖥️ <a href="https://hunyuan.tencent.com" style="color: red;"><b>Official Website</b></a> |
|
| 25 |
🕖 <a href="https://cloud.tencent.com/product/hunyuan"><b>HunyuanAPI</b></a> |
|
| 26 |
-
🕹️ <a href="https://hunyuan.tencent.com/"><b>Demo</b></a>
|
|
|
|
| 27 |
</p>
|
| 28 |
|
|
|
|
| 29 |
<p align="center">
|
| 30 |
<a href="https://github.com/Tencent-Hunyuan/Hunyuan-7B"><b>GITHUB</b></a> |
|
| 31 |
<a href="https://cnb.cool/tencent/hunyuan/Hunyuan-7B"><b>cnb.cool</b></a> |
|
| 32 |
-
<a href="https://github.com/Tencent-Hunyuan/Hunyuan-7B/blob/main/LICENSE"><b>LICENSE</b></a>
|
|
|
|
|
|
|
| 33 |
</p>
|
| 34 |
|
| 35 |
|
|
@@ -47,7 +42,7 @@ We have released a series of Hunyuan dense models, comprising both pre-trained a
|
|
| 47 |
- **Efficient Inference**: Utilizes Grouped Query Attention (GQA) and supports multiple quantization formats, enabling highly efficient inference.
|
| 48 |
|
| 49 |
## Related News
|
| 50 |
-
* 2025.7.30 We have open-sourced **Hunyuan-0.5B-Pretrain** ,
|
| 51 |
<br>
|
| 52 |
|
| 53 |
|
|
|
|
| 4 |
library_name: transformers
|
| 5 |
---
|
| 6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
<p align="center">
|
| 9 |
<img src="https://dscache.tencent-cloud.cn/upload/uploader/hunyuan-64b418fd052c033b228e04bc77bbc4b54fd7f5bc.png" width="400"/> <br>
|
|
|
|
| 11 |
|
| 12 |
|
| 13 |
<p align="center">
|
| 14 |
+
🤗 <a href="https://huggingface.co/tencent/Hunyuan-7B-Instruct-AWQ-Int4"><b>Hugging Face</b></a> |
|
| 15 |
+
🖥️ <a href="https://hunyuan.tencent.com" style="color: red;"><b>Official Website</b></a> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
🕖 <a href="https://cloud.tencent.com/product/hunyuan"><b>HunyuanAPI</b></a> |
|
| 17 |
+
🕹️ <a href="https://hunyuan.tencent.com/"><b>Demo</b></a> |
|
| 18 |
+
🤖 <a href="https://www.modelscope.cn/models/Tencent-Hunyuan/Hunyuan-7B-Instruct-AWQ-Int4"><b>ModelScope</b></a>
|
| 19 |
</p>
|
| 20 |
|
| 21 |
+
|
| 22 |
<p align="center">
|
| 23 |
<a href="https://github.com/Tencent-Hunyuan/Hunyuan-7B"><b>GITHUB</b></a> |
|
| 24 |
<a href="https://cnb.cool/tencent/hunyuan/Hunyuan-7B"><b>cnb.cool</b></a> |
|
| 25 |
+
<a href="https://github.com/Tencent-Hunyuan/Hunyuan-7B/blob/main/LICENSE.txt"><b>LICENSE</b></a> |
|
| 26 |
+
<a href="https://raw.githubusercontent.com/Tencent-Hunyuan/Hunyuan-A13B/main/assets/1751881231452.jpg"><b>WeChat</b></a> |
|
| 27 |
+
<a href="https://discord.gg/bsPcMEtV7v"><b>Discord</b></a>
|
| 28 |
</p>
|
| 29 |
|
| 30 |
|
|
|
|
| 42 |
- **Efficient Inference**: Utilizes Grouped Query Attention (GQA) and supports multiple quantization formats, enabling highly efficient inference.
|
| 43 |
|
| 44 |
## Related News
|
| 45 |
+
* 2025.7.30 We have open-sourced **Hunyuan-0.5B-Pretrain** , **Hunyuan-0.5B-Instruct** , **Hunyuan-1.8B-Pretrain** , **Hunyuan-1.8B-Instruct** , **Hunyuan-4B-Pretrain** , **Hunyuan-4B-Instruct** , **Hunyuan-7B-Pretrain** ,**Hunyuan-7B-Instruct** on Hugging Face.
|
| 46 |
<br>
|
| 47 |
|
| 48 |
|