Skip to content

Commit

Permalink
Fix for "non-iterable NoneType object"
Browse files Browse the repository at this point in the history
  • Loading branch information
tzielinski-habana committed Dec 4, 2024
1 parent 785fc70 commit 52ffbc0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions vllm/worker/hpu_model_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 52ffbc0

Please sign in to comment.