Text Generation
Transformers
Safetensors
hy_v3
hunyuan
hy3
Mixture of Experts
conversational
Eval Results
Instructions to use tencent/Hy3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use tencent/Hy3 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="tencent/Hy3") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("tencent/Hy3") model = AutoModelForCausalLM.from_pretrained("tencent/Hy3", 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]:])) - Inference
- HuggingChat
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use tencent/Hy3 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "tencent/Hy3" # 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/Hy3", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/tencent/Hy3
- SGLang
How to use tencent/Hy3 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/Hy3" \ --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/Hy3", "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/Hy3" \ --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/Hy3", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use tencent/Hy3 with Docker Model Runner:
docker model run hf.co/tencent/Hy3
Upload folder using huggingface_hub
Browse files- README.md +5 -0
- README_CN.md +5 -0
README.md
CHANGED
|
@@ -51,6 +51,7 @@ tags:
|
|
| 51 |
- [vLLM](#vllm)
|
| 52 |
- [SGLang](#sglang)
|
| 53 |
- [Finetuning](#finetuning)
|
|
|
|
| 54 |
- [Quantization](#quantization)
|
| 55 |
- [License](#license)
|
| 56 |
- [Contact Us](#contact-us)
|
|
@@ -215,6 +216,10 @@ python3 -m sglang.launch_server \
|
|
| 215 |
|
| 216 |
Hy3 provides a complete model finetuning pipeline. For detailed documentation, please refer to: [Finetuning Guide](https://huggingface.co/tencent/Hy3/blob/main/finetune/README.md)
|
| 217 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 218 |
## Quantization
|
| 219 |
|
| 220 |
We provide [AngelSlim](https://github.com/tencent/AngelSlim), a more accessible, comprehensive, and efficient toolkit for large model compression. AngelSlim supports a comprehensive suite of compression tools for large-scale multimodal models, including common quantization algorithms, low-bit quantization, and speculative sampling.
|
|
|
|
| 51 |
- [vLLM](#vllm)
|
| 52 |
- [SGLang](#sglang)
|
| 53 |
- [Finetuning](#finetuning)
|
| 54 |
+
- [RL Post-training](#rl-post-training)
|
| 55 |
- [Quantization](#quantization)
|
| 56 |
- [License](#license)
|
| 57 |
- [Contact Us](#contact-us)
|
|
|
|
| 216 |
|
| 217 |
Hy3 provides a complete model finetuning pipeline. For detailed documentation, please refer to: [Finetuning Guide](https://huggingface.co/tencent/Hy3/blob/main/finetune/README.md)
|
| 218 |
|
| 219 |
+
## RL Post-training
|
| 220 |
+
|
| 221 |
+
Hy3 supports GRPO reinforcement learning training with [verl](https://github.com/volcengine/verl), training on Megatron-LM (model conversion via NVIDIA Megatron-Bridge) with vLLM rollout. For detailed documentation, please refer to: [RL Training Guide](https://huggingface.co/tencent/Hy3/blob/main/rl/README.md)
|
| 222 |
+
|
| 223 |
## Quantization
|
| 224 |
|
| 225 |
We provide [AngelSlim](https://github.com/tencent/AngelSlim), a more accessible, comprehensive, and efficient toolkit for large model compression. AngelSlim supports a comprehensive suite of compression tools for large-scale multimodal models, including common quantization algorithms, low-bit quantization, and speculative sampling.
|
README_CN.md
CHANGED
|
@@ -41,6 +41,7 @@
|
|
| 41 |
- [vLLM](#使用-vllm-推理)
|
| 42 |
- [SGLang](#使用-sglang-推理)
|
| 43 |
- [模型微调](#模型微调)
|
|
|
|
| 44 |
- [量化工具](#量化工具)
|
| 45 |
- [许可证](#许可证)
|
| 46 |
- [联系我们](#联系我们)
|
|
@@ -205,6 +206,10 @@ python3 -m sglang.launch_server \
|
|
| 205 |
|
| 206 |
Hy3 提供了完整的模型微调流程,详细的微调文档请参考:[模型微调指南](https://huggingface.co/tencent/Hy3/blob/main/finetune/README_CN.md)
|
| 207 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 208 |
## 量化工具
|
| 209 |
|
| 210 |
我们提供了 [AngelSlim](https://github.com/tencent/AngelSlim)——一套易用、全面、高效的大模型压缩工具包,涵盖常用量化算法、低比特量化和投机采样等能力。
|
|
|
|
| 41 |
- [vLLM](#使用-vllm-推理)
|
| 42 |
- [SGLang](#使用-sglang-推理)
|
| 43 |
- [模型微调](#模型微调)
|
| 44 |
+
- [强化学习训练](#强化学习训练)
|
| 45 |
- [量化工具](#量化工具)
|
| 46 |
- [许可证](#许可证)
|
| 47 |
- [联系我们](#联系我们)
|
|
|
|
| 206 |
|
| 207 |
Hy3 提供了完整的模型微调流程,详细的微调文档请参考:[模型微调指南](https://huggingface.co/tencent/Hy3/blob/main/finetune/README_CN.md)
|
| 208 |
|
| 209 |
+
## 强化学习训练
|
| 210 |
+
|
| 211 |
+
Hy3 支持基于 [verl](https://github.com/volcengine/verl) 的 GRPO 强化学习训练,训练侧使用 Megatron-LM(通过 NVIDIA Megatron-Bridge 完成模型转换),rollout 侧使用 vLLM。详细文档请参考:[强化学习训练指南](https://huggingface.co/tencent/Hy3/blob/main/rl/README_CN.md)
|
| 212 |
+
|
| 213 |
## 量化工具
|
| 214 |
|
| 215 |
我们提供了 [AngelSlim](https://github.com/tencent/AngelSlim)——一套易用、全面、高效的大模型压缩工具包,涵盖常用量化算法、低比特量化和投机采样等能力。
|