Image-Text-to-Text
Transformers
Safetensors
hy_v4_flash
text-generation
hunyuan
hy4-flash
Mixture of Experts
multimodal
instruct
fp8
quantized
conversational
Run this model with HF Jobs
Run tencent/Hy4-flash-FP8 on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/tencent/Hy4-flash-FP8. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/tencent/Hy4-flash-FP8 on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/tencent/Hy4-flash-FP8. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/tencent/Hy4-flash-FP8. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use tencent/Hy4-flash-FP8 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use tencent/Hy4-flash-FP8 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="tencent/Hy4-flash-FP8") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForSeq2SeqLM model = AutoModelForSeq2SeqLM.from_pretrained("tencent/Hy4-flash-FP8", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use tencent/Hy4-flash-FP8 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "tencent/Hy4-flash-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/Hy4-flash-FP8", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/tencent/Hy4-flash-FP8
- SGLang
How to use tencent/Hy4-flash-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/Hy4-flash-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/Hy4-flash-FP8", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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-flash-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/Hy4-flash-FP8", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use tencent/Hy4-flash-FP8 with Docker Model Runner:
docker model run hf.co/tencent/Hy4-flash-FP8
update
Browse filesFiles changed (4)
36 unmodified lines37383936 unmodified linesassets/dfly2.png filter=lfs diff=lfs merge=lfs -textassets/performance-cost-open-benchmarks.png filter=lfs diff=lfs merge=lfs -textassets/performance-cost-workindex.png filter=lfs diff=lfs merge=lfs -text36 unmodified lines3738394036 unmodified linesassets/dfly2.png filter=lfs diff=lfs merge=lfs -textassets/performance-cost-open-benchmarks.png filter=lfs diff=lfs merge=lfs -textassets/performance-cost-workindex.png filter=lfs diff=lfs merge=lfs -textpretrained-model-bpb.png filter=lfs diff=lfs merge=lfs -text
45 unmodified lines46474849505179 unmodified lines13113213313413513645 unmodified lines## Table of Contents- [Model Introduction](#model-introduction)- [Practicality and Cost Efficiency](#practicality-and-cost-efficiency)- [Optimization Approach](#optimization-approach)- [Task Performance and Cost](#task-performance-and-cost)79 unmodified lines| Vision Position Embedding Size | 128 × 128 || Visual Feature Merging | 2 x 2 |## Practicality and Cost Efficiency### Optimization Approach45 unmodified lines4647484950515279 unmodified lines13213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518645 unmodified lines## Table of Contents- [Model Introduction](#model-introduction)- [Pretrained model capability](#pretrained-model-capability)- [Practicality and Cost Efficiency](#practicality-and-cost-efficiency)- [Optimization Approach](#optimization-approach)- [Task Performance and Cost](#task-performance-and-cost)79 unmodified lines| Vision Position Embedding Size | 128 × 128 || Visual Feature Merging | 2 x 2 |## Pretrained model capabilityBits-per-byte (BPB) on internal code & agent validation, lower is better:<p align="center"><a href="pretrained-model-bpb.png"><img src="pretrained-model-bpb.png" alt="Bits-per-byte on internal code and agent validation versus active parameters; lower is better" width="100%"/></a></p>Few-shot pretrain benchmark evaluation:| Category | Benchmark | #Shots | Hy4 flash Base | Hy4 Base | Hy3 preview Base | DeepSeek-V4-flash-Base | DeepSeek-V4-Pro-Base || --- | --- | :---: | ---: | ---: | ---: | ---: | ---: || **Knowledge** | MMLU† | 5 | 88.7 | **91.6** | 87.5 | 89.7 | 91.1 || | MMLU-Pro† | 5 | 71.1 | **73.9** | 65.8 | 68.6 | 73.4 || | MMLU-Redux† | 5 | 87.6 | **90.6** | 87.0 | 88.8 | 90.2 || | SuperGPQA† | 5 | 57.8 | **62.7** | 52.3 | 52.5 | 54.8 || | C-Eval† | 5 | 92.0 | **95.0** | 90.1 | 91.9 | 93.4 || | CMMLU† | 5 | 91.6 | **93.1** | 89.6 | 89.8 | 90.7 || | SimpleQA | 5 | 37.5 | **57.2** | 26.4 | 31.3 | 52.1 || | Chinese-SimpleQA† | 5 | 74.6 | **83.9** | 69.6 | 71.9 | 76.6 || | AGIEval (English)† | 3 | 75.4 | **79.3** | 76.0 | 76.3 | 78.2 || | AGIEval (Chinese)† | 3 | 90.6 | **91.2** | 87.8 | 88.5 | 89.8 || **Reasoning** | HellaSwag (3,000-item subset) | 10 | 85.2 | **87.1** | 85.7 | 85.1 | 86.8 || | PIQA | 4 | 84.4 | **85.3** | 84.6 | 83.8 | 84.9 || | ARC-Challenge | 0 | 95.0 | **97.3** | 96.0 | **97.3** | 97.0 || | Social IQa | 0 | 80.1 | **82.7** | 80.5 | 72.5 | 73.1 || | KOR-Bench | 3 | 54.7 | **57.6** | 54.6 | 53.4 | 55.4 || | C³ | 0 | 77.3 | **82.4** | 75.9 | 74.1 | 78.3 || **Math** | U-MATH | 5 | 69.8 | **71.6** | 60.9 | 57.4 | 64.8 || | OCW Courses | 5 | 64.0 | 66.7 | 62.6 | 63.3 | **68.2** || **Code** | MBPP-plus | 3 | 73.7 | 74.0 | 77.4 | 76.8 | **79.1** || | BigCodeBench (Full) | 0 | 58.8 | 47.9 | **59.6** | 58.0 | 57.5 || **Multilingual** | Belebele (5-language subset)† | 5 | 93.8 | 95.0 | 94.2 | 94.4 | **95.2** || | INCLUDE† | 5 | 82.8 | **88.1** | 84.3 | 84.0 | 84.3 || **Multimodal** | MMMU-Pro (Standard, 10 opts) | 4 | 52.0 | **59.6** | — | — | — || | SimpleVQA | 4 | 48.5 | **54.5** | — | — | — || | CVBench | 4 | 83.4 | **86.7** | — | — | — || | RealWorldQA | 4 | 71.1 | **72.3** | — | — | — || | TextVQA | 4 | 73.4 | **78.2** | — | — | — || | CountBenchQA | 4 | 86.6 | **90.6** | — | — | — |† Macro-averaged accuracy for the marked text benchmarks. Other text rows use the accuracy metric reported by our evaluation suite. Bold marks the highest available numerical score in each row; it does not indicate statistical significance.Multimodal results are reported only for Hy4 flash Base and Hy4 Base.ARC-Challenge and HellaSwag use 299-item and 3,000-item subsets, respectively. INCLUDE uses a 5,000-example Lite subset covering 44 languages. Belebele covers German, Korean, Vietnamese, Spanish, and Russian (4,475 examples in total).**Disclaimer: Because our base model was exposed to a large amount of synthetic instruction data during mid-training, it occasionally fails to follow the expected answer format in few-shot evaluations, which may distort the scores.**## Practicality and Cost Efficiency### Optimization Approach
29 unmodified lines30313233343579 unmodified lines11511611711811912029 unmodified lines## 目录- [模型介绍](#模型介绍)- [实用性与成本效率](#实用性与成本效率)- [优化思路](#优化思路)- [任务效果与成本](#任务效果与成本)79 unmodified lines| Vision Position Embedding Size | 128 × 128 || Visual Feature Merging | 2 x 2 |## 实用性与成本效率### 优化思路29 unmodified lines3031323334353679 unmodified lines11611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917029 unmodified lines## 目录- [模型介绍](#模型介绍)- [预训练模型能力](#预训练模型能力)- [实用性与成本效率](#实用性与成本效率)- [优化思路](#优化思路)- [任务效果与成本](#任务效果与成本)79 unmodified lines| Vision Position Embedding Size | 128 × 128 || Visual Feature Merging | 2 x 2 |## 预训练模型能力内部代码与 Agent 验证集上的 BPB(Bits-per-byte,每字节比特数),数值越低越好:<p align="center"><a href="pretrained-model-bpb.png"><img src="pretrained-model-bpb.png" alt="内部代码与 Agent 验证集上的 BPB 与激活参数量对比,BPB 越低越好" width="100%"/></a></p>预训练模型的 few-shot 基准评测结果:| 类别 | 评测基准 | #Shots | Hy4 flash Base | Hy4 Base | Hy3 preview Base | DeepSeek-V4-flash-Base | DeepSeek-V4-Pro-Base || --- | --- | :---: | ---: | ---: | ---: | ---: | ---: || **知识** | MMLU† | 5 | 88.7 | **91.6** | 87.5 | 89.7 | 91.1 || | MMLU-Pro† | 5 | 71.1 | **73.9** | 65.8 | 68.6 | 73.4 || | MMLU-Redux† | 5 | 87.6 | **90.6** | 87.0 | 88.8 | 90.2 || | SuperGPQA† | 5 | 57.8 | **62.7** | 52.3 | 52.5 | 54.8 || | C-Eval† | 5 | 92.0 | **95.0** | 90.1 | 91.9 | 93.4 || | CMMLU† | 5 | 91.6 | **93.1** | 89.6 | 89.8 | 90.7 || | SimpleQA | 5 | 37.5 | **57.2** | 26.4 | 31.3 | 52.1 || | Chinese-SimpleQA† | 5 | 74.6 | **83.9** | 69.6 | 71.9 | 76.6 || | AGIEval (English)† | 3 | 75.4 | **79.3** | 76.0 | 76.3 | 78.2 || | AGIEval (Chinese)† | 3 | 90.6 | **91.2** | 87.8 | 88.5 | 89.8 || **推理** | HellaSwag (3,000-item subset) | 10 | 85.2 | **87.1** | 85.7 | 85.1 | 86.8 || | PIQA | 4 | 84.4 | **85.3** | 84.6 | 83.8 | 84.9 || | ARC-Challenge | 0 | 95.0 | **97.3** | 96.0 | **97.3** | 97.0 || | Social IQa | 0 | 80.1 | **82.7** | 80.5 | 72.5 | 73.1 || | KOR-Bench | 3 | 54.7 | **57.6** | 54.6 | 53.4 | 55.4 || | C³ | 0 | 77.3 | **82.4** | 75.9 | 74.1 | 78.3 || **数学** | U-MATH | 5 | 69.8 | **71.6** | 60.9 | 57.4 | 64.8 || | OCW Courses | 5 | 64.0 | 66.7 | 62.6 | 63.3 | **68.2** || **代码** | MBPP-plus | 3 | 73.7 | 74.0 | 77.4 | 76.8 | **79.1** || | BigCodeBench (Full) | 0 | 58.8 | 47.9 | **59.6** | 58.0 | 57.5 || **多语言** | Belebele (5-language subset)† | 5 | 93.8 | 95.0 | 94.2 | 94.4 | **95.2** || | INCLUDE† | 5 | 82.8 | **88.1** | 84.3 | 84.0 | 84.3 || **多模态** | MMMU-Pro (Standard, 10 opts) | 4 | 52.0 | **59.6** | — | — | — || | SimpleVQA | 4 | 48.5 | **54.5** | — | — | — || | CVBench | 4 | 83.4 | **86.7** | — | — | — || | RealWorldQA | 4 | 71.1 | **72.3** | — | — | — || | TextVQA | 4 | 73.4 | **78.2** | — | — | — || | CountBenchQA | 4 | 86.6 | **90.6** | — | — | — |† 标注的文本评测采用宏平均准确率,其余文本评测采用本评测框架报告的准确率。每行最高分以粗体标示;加粗不代表差异具有统计显著性。多模态结果仅列出 Hy4 flash Base 和 Hy4 Base。ARC-Challenge 和 HellaSwag 分别使用包含 299 道和 3,000 道题目的子集。INCLUDE 使用覆盖 44 种语言、包含 5,000 个样本的 Lite 子集。Belebele 覆盖德语、韩语、越南语、西班牙语和俄语,共 4,475 个样本。**免责声明:我们的基座模型在中期训练中使用了大量合成指令数据,因此在 few-shot 评测中偶尔无法遵循预期的答案格式,可能导致得分失真。**## 实用性与成本效率### 优化思路
.gitattributes+1
README.md+50
README_CN.md+50
pretrained-model-bpb.pngAdded

Large File Pointer Details
- SHA256: 1ad7aada7fcac0f34a88b629789bb6dce512b403b310faa5f7201dfc013b9640
- Pointer size: 131 Bytes
- Size of remote file: 400 kB