Skip to content

Conversation

@qusaiw
Copy link

@qusaiw qusaiw commented Oct 27, 2025

This PR updates all example scripts in the Alignment Handbook to replace the deprecated max_seq_length parameter with max_length, matching the current SFTTrainer API in trl.

Context:
Recent versions of trl have renamed max_seq_length → max_length, causing example scripts to raise errors such as:

TypeError: SFTTrainer.__init__() got an unexpected keyword argument 'max_seq_length'

Changes:
• Updated all occurrences of max_seq_length → max_length in example scripts.
• No modifications to library or trainer code — only examples were adjusted for compatibility.

Impact:
Examples now run correctly with the latest trl releases, improving out-of-the-box usability.

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.

1 participant