[Glm46v] Bug fix for accuracy drop and unable to launch server (#14585)

Co-authored-by: yhyang201 <yhyang201@gmail.com>
Co-authored-by: zRzRzRzRzRzRzR <2448370773@qq.com>
Co-authored-by: Minglei Zhu <mingleizhu1122@gmail.com>
This commit is contained in:
Binyao Jiang
2025-12-07 23:45:02 -08:00
committed by GitHub
parent a2ca9bd4f1
commit cf0478d602
12 changed files with 308 additions and 29 deletions

View File

@@ -112,6 +112,14 @@ class ThinkingBudgetLogitProcessor(CustomLogitProcessor):
return logits
class Glm4MoeThinkingBudgetLogitProcessor(ThinkingBudgetLogitProcessor):
"""A logit processor that controls the length of thinking for GLM-4.5 / GLM-4.6 / GLM-4.5V / GLM-4.6V models."""
THINKING_START_TOKEN_ID: int = 151350
THINKING_END_TOKEN_ID: int = 151351
NEW_LINE_TOKEN_ID: int = 198
class Qwen3ThinkingBudgetLogitProcessor(ThinkingBudgetLogitProcessor):
"""A logit processor that controls the length of thinking for Qwen3 models."""