Commit b279bd1
committed
fix(generate): handle None entries in GenerationBatch logits_processors
self.logits_processors can be a mixed list of None and List[Callable] after
batches with and without processors are merged via extend(). The any() guard
at line 1337 returns True for [None, [fn]] but the inner loop assumes every
element is iterable, raising TypeError on None entries.
Reproduce: BatchGenerator with no constructor processors, insert one prompt
with no per-element processors and another with logits_processors=[[fn]],
then call next_generated().
Mirrors the existing 'samplers[e] or self.fallback_sampler' pattern at
line 1358.1 parent ed1fca4 commit b279bd1
2 files changed
Lines changed: 18 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1343 | 1343 | | |
1344 | 1344 | | |
1345 | 1345 | | |
1346 | | - | |
| 1346 | + | |
1347 | 1347 | | |
1348 | 1348 | | |
1349 | 1349 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
402 | 402 | | |
403 | 403 | | |
404 | 404 | | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
405 | 422 | | |
406 | 423 | | |
407 | 424 | | |
| |||
0 commit comments