[Trainer] Move NEFTune impl to standalone functions
by SunMarc
·
Feb 06, 2026 at 19:25 UTC
·
scan-fd6e2a75d55aecaa
Get this automatically on every PR
Install the Axiomo GitHub App to get Signals as check runs and PR comments on every pull request.
Risk level: Medium (45%)
Refactor NEFTune code to standalone functions from Trainer methods.
New neftune.py created with functions and removed from trainer.py.
Imports updated in trainer.py and trainer_utils.py.
test_trainer.py includes new import for NEFTune functions.
Trusted contributor with 205 merged PRs. has 259 followers. unfamiliar with src/transformers/integrations/neftune.py.
First-time contributor to this repository.
Focus on 1 critical file(s)
src/transformers/integrations/neftune.py
+114
114 lines changed; New file; Source code
src/transformers/trainer.py
+52
52 lines changed; Source code
src/transformers/trainer_utils.py
+36
Source code
src/transformers/integrations/__init__.py
+6
Source code
tests/trainer/test_trainer.py
+3
Source code
36
minutes to review
high
effort level
none
staleness risk
Allocate focused review time
Some concerns to address before approval
Why is lint_passing missing? Consider adding this check.
Why is security_scan_clean missing? Consider adding this check.
src/transformers/integrations/neftune.py
Critical file: 114 lines changed; New file; Source code