Skip to content

Add handle_generation_config function to manage model generation_config saving failure#1448

Merged
xin3he merged 5 commits intomainfrom
xinhe/2-12a
Mar 4, 2026
Merged

Add handle_generation_config function to manage model generation_config saving failure#1448
xin3he merged 5 commits intomainfrom
xinhe/2-12a

Conversation

@xin3he
Copy link
Copy Markdown
Contributor

@xin3he xin3he commented Feb 12, 2026

Description

huggingface/transformers#43937

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Performance improvement
  • Code refactoring
  • Other (please specify):

Related Issues

Fixes or relates to #

Checklist Before Submitting

  • My code has been tested locally.
  • Documentation has been updated as needed.
  • New or updated tests are included where applicable.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a helper to adjust generation_config.do_sample based on sampling-related parameters to avoid failures when working with non-default generation settings.

Changes:

  • Invoke a new handle_generation_config() during both LLM and MLLM model load flows.
  • Add handle_generation_config() to set do_sample=True when top_p, top_k, or temperature indicates sampling.

Signed-off-by: He, Xin3 <xin3.he@intel.com>
@xin3he xin3he merged commit 32c1e3c into main Mar 4, 2026
29 checks passed
@xin3he xin3he deleted the xinhe/2-12a branch March 4, 2026 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants