Text Generation
Transformers
Safetensors
hy_v4
hunyuan
hy4
Mixture of Experts
conversational
Eval Results
Instructions to use tencent/Hy4-preview with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use tencent/Hy4-preview with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="tencent/Hy4-preview") 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/Hy4-preview") model = AutoModelForCausalLM.from_pretrained("tencent/Hy4-preview", 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]:])) - Inference
- HuggingChat
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use tencent/Hy4-preview with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "tencent/Hy4-preview" # 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/Hy4-preview", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/tencent/Hy4-preview
- SGLang
How to use tencent/Hy4-preview 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/Hy4-preview" \ --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/Hy4-preview", "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/Hy4-preview" \ --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/Hy4-preview", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use tencent/Hy4-preview with Docker Model Runner:
docker model run hf.co/tencent/Hy4-preview
Upload folder using huggingface_hub
Browse files- README.md +1 -1
- README_CN.md +1 -1
README.md
CHANGED
|
@@ -120,7 +120,7 @@ We also continue to co-design Hy4 preview with Tencent products like CodeBuddy a
|
|
| 120 |
|
| 121 |
## Known Limitations
|
| 122 |
|
| 123 |
-
This is an early version of Hy4. There is real headroom left in both pre-training and post-training, and we are shipping with known issues — among them, spending longer than necessary reasoning through complex tasks, and a tendency to over-verify its own work. As with Hy3 preview, we would rather ship early and hear what breaks — that's what made Hy3 substantially better, and it's how we will get Hy4 right. We will also keep collaborating closely with Tencent's products and in-house experts to push the boundaries of model intelligence while making it more abundant and affordable.
|
| 124 |
|
| 125 |
## News
|
| 126 |
|
|
|
|
| 120 |
|
| 121 |
## Known Limitations
|
| 122 |
|
| 123 |
+
This is an early version of Hy4. There is real headroom left in both pre-training and post-training, and we are shipping with known issues — among them, spending longer than necessary reasoning through complex tasks, and a tendency to over-verify its own work. We'll keep iterating quickly on these. As with Hy3 preview, we would rather ship early and hear what breaks — that's what made Hy3 substantially better, and it's how we will get Hy4 right. We will also keep collaborating closely with Tencent's products and in-house experts to push the boundaries of model intelligence while making it more abundant and affordable.
|
| 124 |
|
| 125 |
## News
|
| 126 |
|
README_CN.md
CHANGED
|
@@ -110,7 +110,7 @@ Hy4 preview 在模型尺寸、上下文长度、数据规模上都进行了显
|
|
| 110 |
|
| 111 |
## 已知局限
|
| 112 |
|
| 113 |
-
Hy4 preview 是 Hy4 迭代的一个早期版本,预训练和后训练均仍有较大的提升空间,也有一些已知问题,如复杂任务
|
| 114 |
|
| 115 |
## 新闻
|
| 116 |
|
|
|
|
| 110 |
|
| 111 |
## 已知局限
|
| 112 |
|
| 113 |
+
Hy4 preview 是 Hy4 迭代的一个早期版本,预训练和后训练均仍有较大的提升空间,也有一些已知问题,如复杂任务的长思考和过度自我验证倾向,我们将持续敏捷迭代。如同 Hy3 preview,我们希望通过 Hy4 preview 的尽快发布获得广泛的真实反馈,从而显著提升 Hy4 正式版。同时,我们将坚持发挥与腾讯产品和专家深度合作的独特优势,持续提升生产力的普惠性和上限。
|
| 114 |
|
| 115 |
## 新闻
|
| 116 |
|