From a9c6b52205c3911e0725549c0fcdd7089e8f25a7 Mon Sep 17 00:00:00 2001 From: Li Wang Date: Thu, 24 Apr 2025 15:21:57 +0800 Subject: [PATCH] [Bugfix] Fix qwen2.5-vl positon input bug (#639) ### What this PR does / why we need it? Fix qwen2.5-vl positon input bug, fix #625 `TypeError: 'NoneType' object is not iterable` Signed-off-by: wangli --- vllm_ascend/worker/model_runner.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vllm_ascend/worker/model_runner.py b/vllm_ascend/worker/model_runner.py index f2a62d9..bfcdc14 100644 --- a/vllm_ascend/worker/model_runner.py +++ b/vllm_ascend/worker/model_runner.py @@ -556,7 +556,8 @@ class ModelInputForNPUBuilder(ModelRunnerInputBuilderBase[ModelInputForNPU]): #print(f"before tensor input_positions: {input_positions}") #print(f"before list seq_lens: {seq_lens}") input_tokens = flatten_2d_lists(input_tokens) - input_positions = flatten_2d_lists(input_positions) + if input_positions: + input_positions = flatten_2d_lists(input_positions) if graph_pad_size != -1 and not is_prompt: input_tokens.extend(itertools.repeat(0, graph_pad_size)) input_positions.extend( # type: ignore