Commit 3788fea
granite4_vision: replace unbound forward call with self.language_model()
The Granite4VisionTextModel.forward(self.language_model, ...) pattern was
added to bypass nn.Module.__call__ overhead, but compare_implementations
shows no measurable difference (1.05x total vs card, within noise).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: artemspector <artems@il.ibm.com>1 parent fa6bd19 commit 3788fea
2 files changed
Lines changed: 2 additions & 8 deletions
File tree
- src/transformers/models/granite4_vision
Lines changed: 1 addition & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1045 | 1045 | | |
1046 | 1046 | | |
1047 | 1047 | | |
1048 | | - | |
1049 | | - | |
1050 | | - | |
1051 | | - | |
| 1048 | + | |
1052 | 1049 | | |
1053 | 1050 | | |
1054 | 1051 | | |
| |||
Lines changed: 1 addition & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
704 | 704 | | |
705 | 705 | | |
706 | 706 | | |
707 | | - | |
708 | | - | |
709 | | - | |
710 | | - | |
| 707 | + | |
711 | 708 | | |
712 | 709 | | |
713 | 710 | | |
| |||
0 commit comments