From 52ffbc0442046d1108a2244b4faa54378f2a8c30 Mon Sep 17 00:00:00 2001 From: Tomasz Zielinski Date: Wed, 4 Dec 2024 11:46:14 +0200 Subject: [PATCH] Fix for "non-iterable NoneType object" --- vllm/worker/hpu_model_runner.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vllm/worker/hpu_model_runner.py b/vllm/worker/hpu_model_runner.py index 683f15baf06c0..3af5cd1976230 100755 --- a/vllm/worker/hpu_model_runner.py +++ b/vllm/worker/hpu_model_runner.py @@ -177,10 +177,13 @@ def get_names_for_rope(model: torch.nn.Module): """ def get_child(parent, suffix, is_list=False): + if parent is None: + return None, None parent = parent[0] if is_list else parent for child_name, child_module in parent.named_children(): if child_module.__class__.__name__.endswith(suffix): return child_name, child_module + return None, None model_name, model_module = get_child(model, "Model") layers_name, layers_module = get_child(model_module, "ModuleList")