fix move model

This commit is contained in:
Vladimir Mandic
2024-03-05 21:44:20 -05:00
parent 9054b5cf79
commit 76b0017675
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -758,7 +758,7 @@ def move_model(model, device=None, force=False):
if hasattr(model, "components"): # accelerate patch
for name, m in model.components.items():
if not hasattr(m, "_hf_hook"): # not accelerate hook
return
break
if not isinstance(m, torch.nn.Module) or name in model._exclude_from_cpu_offload: # pylint: disable=protected-access
continue
for module in m.modules():