transformers
8ca0fbec - Fix crash in greedy assisted generation with different tokenizers (#46936)

Commit
138 days ago
Fix crash in greedy assisted generation with different tokenizers (#46936) Greedy Universal Assisted Generation (do_sample=False with the main and assistant models on different tokenizers) crashed with a tensor-size RuntimeError. The assistant re-encodes the prompt to a different length, but the main model position_ids were inherited unchanged into the assistant first draft round, mismatching its input length. Drop the inherited position_ids before the assistant generates, next to the existing attention_mask pop, so the assistant rebuilds them from its own input. Greedy assisted decoding stays lossless versus plain greedy.
Author
Parents
Loading