You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix verifier kwarg leaking into draft model constructors (#669)
<!-- markdownlint-disable -->
> ⚠️ **DO NOT MERGE before #672.** This PR is stacked on #672 (remove
eagle converter) and its base is `remove-eagle-converter`. Merging this
first would pull in #672's changes prematurely and/or land against the
wrong base. Merge order: **#672 first, then this.** Once #672 merges, I
will rebase this onto `main`. The diff here is the 3-line loader change
only.
## Purpose
Fix `TypeError: Eagle3DraftModel.__init__() got an unexpected keyword
argument 'verifier'` raised during draft model construction in
`scripts/train.py --from-pretrained`.
This breaks the EAGLE3 finetuning smoke test:
```
tests/e2e/smoke/test_finetuning_sanity.py::test_finetuning_weight_sanity
TypeError: Eagle3DraftModel.__init__() got an unexpected keyword argument 'verifier'
```
`build_draft_model` passes `verifier=args.verifier_name_or_path` to
`from_pretrained` (for the external-checkpoint auto-convert path added
in #617). `SpeculatorModel.from_pretrained` had no `verifier` parameter,
so it stayed in `**kwargs`, was forwarded to HF's `from_pretrained`, and
reached the model constructor `cls(config, **kwargs)`. Draft models take
only `config` and reject it.
## Fix
Make `verifier` an explicit named parameter of
`SpeculatorModel.from_pretrained` so it is consumed at the loader
boundary (never forwarded into the constructor), used directly for
auto-conversion, and forwarded through the base-class re-dispatch
alongside `t2d`/`d2t`.
With the attachment-style `EagleSpeculator` removed in #672, no model
constructor takes `verifier` anymore, so consuming it is sufficient — no
per-model special-casing needed.
## Tests
- Failing test fixed:
`tests/e2e/smoke/test_finetuning_sanity.py::test_finetuning_weight_sanity`
(covered on CI).
- `make style` / `make quality`: pass.
- `pytest tests/unit/test_model.py
tests/unit/convert/test_entrypoints.py`: 20 passed.
## Checklist
I have filled in:
- [x] The purpose of the PR, such as "Fix some issue (link existing
issues this PR will resolve)".
- [x] The test plan/results, such as providing test command and pasting
the results.
- [ ] (Optional) The necessary documentation update.
- [x] I (a human) have written or reviewed the code in this pr to the
best of my ability.
---------
Signed-off-by: shanjiaz <hezhao@redhat.com>
Signed-off-by: Rahul-Tuli <rtuli@redhat.com>
Co-authored-by: shanjiaz <hezhao@redhat.com>
0 commit comments