Commit 558fc6d
authored
[Bug] Fix AssertionError with Gemma2 (#1277)
Gemma2 has a non-croppable cache, so the cache is reset every time we do
a forward pass that doesn't simply append tokens. In this case,
`num_cached` wasn't being set to 0 like `past_length`, causing a later
assertion to fail.
Note that this fix does not change any behaviors, as `num_cached` isn't
actually used for anything after this line (except for the assertion).1 parent d5d381f commit 558fc6d
1 file changed
Lines changed: 6 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
541 | 541 | | |
542 | 542 | | |
543 | 543 | | |
544 | | - | |
545 | 544 | | |
546 | 545 | | |
547 | | - | |
| 546 | + | |
548 | 547 | | |
549 | 548 | | |
550 | 549 | | |
551 | | - | |
| 550 | + | |
552 | 551 | | |
553 | 552 | | |
554 | 553 | | |
| |||
558 | 557 | | |
559 | 558 | | |
560 | 559 | | |
561 | | - | |
562 | | - | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
563 | 564 | | |
564 | 565 | | |
565 | 566 | | |
| |||
0 commit comments