Instructions to use immanuelpeter/Hy4-Vision with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use immanuelpeter/Hy4-Vision with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-feature-extraction", model="immanuelpeter/Hy4-Vision", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("immanuelpeter/Hy4-Vision", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Hy4-Vision
This repository packages the vision Tower and Projector from Tencent Hy4.
Contents
| File | Tensors | What it holds |
|---|---|---|
model.safetensors |
649 | 643 Tower and 6 Projector tensors from vit.* |
modeling_hy4.py |
Standalone Tower and Projector (trust_remote_code=True) |
|
config.json |
Vision configuration and AutoModel mapping |
|
export_manifest.json |
Source pin, shards and tensor counts |
Architecture
| Component | Details |
|---|---|
| Tower | 40 blocks, 1536 hidden, 6144 MLP, 16 heads, patch size 16, GELU, learned 128 x 128 absolute positions |
| Projector | RMSNorm, Conv2d(1536, 6144, 2, stride 2), GELU, Conv2d(6144, 6144, 1) |
At 512 px this gives 1024 Tower tokens (1536-d), 256 merged tokens (6144-d), and 256 projected tokens (6144-d).
Usage
See examples/inference.py for image feature extraction. AutoModel.from_pretrained(..., trust_remote_code=True) loads modeling_hy4.py.
Validation
The parity check verifies all 649 tensors against the pinned parent with torch.equal and compares forward outputs against the hy_v4_vl reference in Transformers.
Reproduction
The export script range-reads the 649 vit.* tensors from the pinned parent and writes the original BF16 tensors.
Credits
Tencent released the Hy4 weights. The vision forward follows Hugging Face Transformers.
License
Weights use the Tencent Hy License, Version 1.0 (Section 10 adds terms for large Model-as-a-Service businesses). Code is MIT; see NOTICE for attribution.
- Downloads last month
- 54
Model tree for immanuelpeter/Hy4-Vision
Base model
tencent/Hy4