-
Notifications
You must be signed in to change notification settings - Fork 903
Update seed.py #5725
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update seed.py #5725
Conversation
兼容no think数据中包含\n\n\n\n;目前这部分数据budget被设置为512,正常应该是0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary of Changes
Hello @hpsun1109, 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!
此拉取请求旨在修复LLM模板中思考预算计算的一个缺陷。它通过引入一个条件检查来确保只有在think
标签包含实际文本内容时才计算其token长度,从而避免了因空白或仅含换行符的think
内容导致预算被错误地设置为非零值(例如512)的问题。这一改动提高了预算分配的准确性,特别是对于那些不应有思考预算的数据。
Highlights
- 修复思考预算计算错误: 解决了当
think
标签内容为空或仅包含空白字符(如换行符)时,思考预算被错误地计算为非零值的问题。 - 优化空白内容处理: 确保只有当
think
标签内包含实际内容时才计算其token长度,从而避免了对“无思考”数据的错误预算分配。
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command>
or @gemini-code-assist <command>
. Below is a summary of the supported commands.
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 issue 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
-
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. ↩
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
本次变更修复了当 <think>
标签中只包含换行符等空白字符时,thinking_budget
被错误计算的问题。通过增加对 think
内容的检查,确保了只在 think
标签内有实际内容时才计算token长度,从而避免了错误的budget设置。此修复是正确且必要的。我提供了一个小建议以提高代码的简洁性。
if thinking_token_len > max_length: | ||
max_length = thinking_token_len |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Jintao-Huang 解决no think数据中包含<think> \n\n</think>\n\n字段会被误判断为budget=512的问题 |
兼容no think数据中包含\n\n\n\n;目前这部分数据budget被设置为512,正常应该是0
兼容no think数据中包含<think> \n\n</think>\n\n;目前这部分数据budget被设置为512,正常应该是0
PR type
PR information
Write the detail information belongs to this PR.
Experiment results
Paste your experiment result here(if needed).