Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions batchgen/get_initializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,14 @@ def get_initializer(model_name:str):
elif "glm-5" in model_lower:
from batchgen.models.glm.glm5.glm5_initializer import GLM5Initializer
return GLM5Initializer
elif model_lower in [
"tencent/hy4",
"tencent/hy4-fp8",
"hy4-a49b",
]:
# Exact names only: a bare "hy4" substring would also match
# hy4-flash, which is a different architecture (own package).
from batchgen.models.hy.hy_v4.hy_v4_initializer import HyV4Initializer
return HyV4Initializer
else:
raise ValueError(f"Unsupported model name: {model_name}")
9 changes: 9 additions & 0 deletions batchgen/get_parallel_strategy_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,14 @@ def get_parallel_strategy_manager(model_name:str):
elif "glm-5" in model_lower:
from batchgen.models.glm.glm5.Parallel_Strategy_Manager import GLM5ParallelStrategyManager
return GLM5ParallelStrategyManager
elif model_lower in [
"tencent/hy4",
"tencent/hy4-fp8",
"hy4-a49b",
]:
# Exact names only: a bare "hy4" substring would also match
# hy4-flash, which is a different architecture (own package).
from batchgen.models.hy.hy_v4.Parallel_Strategy_Manager import HyV4ParallelStrategyManager
return HyV4ParallelStrategyManager
else:
raise ValueError(f"Unsupported model name: {model_name}")
Empty file.
1,215 changes: 1,215 additions & 0 deletions batchgen/models/hy/hy_v4/Parallel_Strategy_Manager.py

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions batchgen/models/hy/hy_v4/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
"""HY4 A49B (Tencent HY4 flagship, HF tencent/Hy4) — BatchGen package.

Exact-model registration (FAIL FAST: registries key on the exact model,
never a family prefix). Importing this package registers HyV4Config under
model_type "hy_v4_vl" via the register_config decorator.

Text path first; the vision tower is a follow-up sub-project
(batchgen-hy4-a49b-model-support, Scope).
"""

from .config import HyV4Config # noqa: F401 (import registers the config)
19 changes: 19 additions & 0 deletions batchgen/models/hy/hy_v4/assets/UPSTREAM_SOURCE.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"repo_id": "tencent/Hy4",
"mirror": "HuggingFace Hub",
"mirror_url": "https://huggingface.co/tencent/Hy4",
"revision": "main",
"download_scope": "Tokenizer surface only: tokenizer.json, tokenizer_config.json, generation_config.json, chat_template.jinja",
"md5": {
"chat_template.jinja": "49cb6d54d9cc23a877bbf3c3ade0a1d7",
"generation_config.json": "f0108adcc8428ee9ec3ddd3f06209554",
"tokenizer.json": "a2c2b1320e95e8bb64cfd0e5f52d9a8d",
"tokenizer_config.json": "7bd05adaf2b99e8fbd967fc2f1928ef7"
},
"notes": [
"Downloaded 2026-11-30 via direct resolve URLs from the public HF repo.",
"No-oracle vendoring path: these md5s MUST be re-verified against the SERVED checkpoint once it is staged; a mismatch is a hard error (checkpoint assets are the source of truth).",
"tokenizer_config.json has an EMPTY added_tokens_decoder and no chat_template key: the special-token table is built from tokenizer.json added_tokens (832 entries, ids 120000-120831), and the chat template is the standalone chat_template.jinja.",
"eos/bos/pad agree across generation_config (120025/120000/120002) and tokenizer_config token strings."
]
}
355 changes: 355 additions & 0 deletions batchgen/models/hy/hy_v4/assets/chat_template.jinja

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions batchgen/models/hy/hy_v4/assets/generation_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"bos_token_id": 120000,
"do_sample": true,
"eos_token_id": 120025,
"pad_token_id": 120002,
"temperature": 0.9,
"top_k": -1,
"top_p": 1,
"transformers_version": "5.24.0"
}
Loading
Loading