Commit 37a6869
committed
olmo2: stop generation at the end-of-sequence token
A 200-token run walked straight through <|endoftext|> and started a fresh
document mid-response, which is what a base model does when nothing stops it.
The runner now reads eos_token_id from config.json and stops before emitting
the sentinel rather than after, because a caller wants the text and not the
marker. The serving lane does the same.
Also verified while looking: 200 tokens stay finite with no NaN and no
collapse, so the f16 residual holds across sixteen post-norm layers, and the
same prompt produces bit-identical output across runs.
Error paths all explain themselves rather than failing obscurely. A Qwen config
is refused by name, a missing file by path, and a SmolLM-shaped head_dim 64 with
the reason it cannot work here.1 parent 4e13954 commit 37a6869
2 files changed
Lines changed: 24 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
| 160 | + | |
160 | 161 | | |
161 | 162 | | |
162 | 163 | | |
163 | 164 | | |
164 | 165 | | |
165 | 166 | | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
166 | 171 | | |
167 | 172 | | |
168 | 173 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
| 96 | + | |
| 97 | + | |
96 | 98 | | |
97 | 99 | | |
98 | 100 | | |
| |||
132 | 134 | | |
133 | 135 | | |
134 | 136 | | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
135 | 141 | | |
136 | 142 | | |
137 | 143 | | |
| |||
378 | 384 | | |
379 | 385 | | |
380 | 386 | | |
| 387 | + | |
381 | 388 | | |
382 | 389 | | |
383 | 390 | | |
| |||
1552 | 1559 | | |
1553 | 1560 | | |
1554 | 1561 | | |
| 1562 | + | |
| 1563 | + | |
| 1564 | + | |
| 1565 | + | |
| 1566 | + | |
1555 | 1567 | | |
1556 | 1568 | | |
1557 | 1569 | | |
| |||
1570 | 1582 | | |
1571 | 1583 | | |
1572 | 1584 | | |
| 1585 | + | |
1573 | 1586 | | |
1574 | 1587 | | |
| 1588 | + | |
| 1589 | + | |
| 1590 | + | |
| 1591 | + | |
| 1592 | + | |
| 1593 | + | |
1575 | 1594 | | |
1576 | 1595 | | |
1577 | 1596 | | |
| |||
0 commit comments