Skip to content

fix unsloth sft config in SFT and QLoRA#62

Merged
RETR0-OS merged 1 commit intomainfrom
bug-fixes
Mar 13, 2026
Merged

fix unsloth sft config in SFT and QLoRA#62
RETR0-OS merged 1 commit intomainfrom
bug-fixes

Conversation

@RETR0-OS
Copy link
Member

Fix bugs in the CLI

Copilot AI review requested due to automatic review settings March 13, 2026 08:35
@RETR0-OS RETR0-OS merged commit f610f67 into main Mar 13, 2026
1 check passed
Copy link
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

This PR fixes Unsloth-related trainer configuration issues in the fine-tuning CLI by avoiding passing group_by_length into Unsloth’s patched SFTConfig, while keeping existing behavior for the standard Hugging Face/TRL path.

Changes:

  • Refactors SFT/QLoRA trainer argument construction to build SFTConfig from a kwargs dict.
  • Conditionally includes group_by_length only when PEFT is not already applied (i.e., non-Unsloth path).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
ModelForge/strategies/sft_strategy.py Builds SFTConfig via sft_kwargs and avoids group_by_length when Unsloth pre-applied PEFT is detected.
ModelForge/strategies/qlora_strategy.py Mirrors the same conditional group_by_length handling for QLoRA’s SFTConfig.

You can also share your feedback on Copilot code review. Take the survey.

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.

2 participants