Handle input-embed-only batches in eager runner (#29121)

Co-authored-by: Cheng Wan <54331508+ch-wan@users.noreply.github.com>
This commit is contained in:
Lianmin Zheng
2026-06-24 10:33:52 -07:00
committed by GitHub
co-authored by Cheng Wan
parent 76db6c9d9e
commit d6aacd2801
@@ -169,7 +169,12 @@ class EagerRunner(BaseRunner):
if envs.SGLANG_EAGER_INPUT_NO_COPY.get():
return replace(forward_batch)
raw_bs = forward_batch.batch_size
raw_num_tokens = forward_batch.input_ids.shape[0]
if forward_batch.input_ids is not None:
raw_num_tokens = forward_batch.input_ids.shape[0]
elif forward_batch.input_embeds is not None:
raw_num_tokens = forward_batch.input_embeds.shape[0]
else:
raw_num_tokens = 0
registry = self._eager_registry
registry.fill_from(
forward_batch,