Repository navigation
Fix legacy on_non_divisible fill for subclasses (STEEGFormer wrappers); trim #1399 - #1407
Merged
bruAristimunha merged 5 commits intoOct 14, 2026
Merged
Conversation
A subclass with its own signature (neuraltrain's STEEGFormerEncoderCompatible) got on_non_divisible='crop' injected by from_pretrained and raised TypeError: 1,163 NeuralBench matrix cells (all four STEEGFormer configs) on master.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1407 +/- ##
==========================================
- Coverage 90.14% 90.13% -0.01%
==========================================
Files 167 167
Lines 21817 21809 -8
==========================================
- Hits 19666 19657 -9
- Misses 2151 2152 +1 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #1399.
Fix.
from_config/from_pretrainedfilledon_non_divisible="crop"for configs saved before the option existed, even when the class being loaded is a subclass whose__init__doesn't take that argument. A downstream wrapper, neuraltrain'sSTEEGFormerEncoderCompatible, then raisedTypeError: unexpected keyword argument 'on_non_divisible'. That broke 1,163 cells of the NeuralBench model×study check on master, across all four STEEGFormer configs. The fill now only happens when the__init__accepts the argument; a regression test covers it.Trim. Same behaviour, less code:
_patch_countand_pad_or_crop_to_patcheswithout the long docstrings.