Skip to content

update custom_logit_processor.py for. GLM-4.5 and GLM-4.6 support#14568

Closed
zRzRzRzRzRzRzR wants to merge 9 commits intosgl-project:mainfrom
zRzRzRzRzRzRzR:glm
Closed

update custom_logit_processor.py for. GLM-4.5 and GLM-4.6 support#14568
zRzRzRzRzRzRzR wants to merge 9 commits intosgl-project:mainfrom
zRzRzRzRzRzRzR:glm

Conversation

@zRzRzRzRzRzRzR
Copy link
Contributor

No description provided.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @zRzRzRzRzRzRzR, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the system's capability to integrate with GLM-4.5 and GLM-4.6 models by adding a dedicated logit processor. This ensures that the 'thinking' phase of these specific models is correctly managed through their unique token identifiers, which is crucial for their proper operation and output generation.

Highlights

  • New GLM-4.5/4.6 Logit Processor: A new logit processor, Glm4MoeThinkingBudgetLogitProcessor, has been introduced to specifically support GLM-4.5, GLM-4.6, GLM-4.5V, and GLM-4.6V models.
  • Model-Specific Token IDs: This new processor defines specific THINKING_START_TOKEN_ID, THINKING_END_TOKEN_ID, and NEW_LINE_TOKEN_ID tailored for the GLM-4.5 and GLM-4.6 series models, inheriting from ThinkingBudgetLogitProcessor.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces the Glm4MoeThinkingBudgetLogitProcessor to support thinking budget control for GLM-4.5 and GLM-4.6 models. The implementation correctly follows the existing design by subclassing ThinkingBudgetLogitProcessor and providing the necessary model-specific token IDs. The change is clean, well-documented, and appears correct. I have no suggestions for improvement.

@github-actions github-actions bot added the documentation Improvements or additions to documentation label Dec 7, 2025
@yhyang201
Copy link
Collaborator

/tag-and-rerun-ci

@github-actions github-actions bot added the run-ci label Dec 7, 2025
@byjiang1996
Copy link
Collaborator

Thanks for your PR. I just cherry-picked into my branch and added you as coauthor. Let's track this PR instead: #14585. Thank you for your understanding!

@byjiang1996 byjiang1996 closed this Dec 8, 2025
@zRzRzRzRzRzRzR zRzRzRzRzRzRzR deleted the glm branch December 8, 2025 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation run-ci

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants