Skip to content

Commit

Permalink
fix bug in _get_named_modules (#3052)
Browse files Browse the repository at this point in the history
* bug fix

* bug fix
  • Loading branch information
faaany authored Sep 6, 2024
1 parent 5ad982a commit e7e0181
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/accelerate/utils/modeling.py
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ def _get_named_modules(
memo.add(module)
yield prefix, module
for name, sub_module in module._modules.items():
if module is None:
if sub_module is None:
continue
submodule_prefix = prefix + ("." if prefix else "") + name
yield from _get_named_modules(sub_module, memo, submodule_prefix, remove_duplicate)
Expand Down

0 comments on commit e7e0181

Please sign in to comment.