move_model_to_devices no longer crashes if you don't have accelerate
This commit is contained in:
parent
f2c5bb5cb7
commit
6b172306f6
|
@ -633,8 +633,9 @@ def move_model_to_devices(model):
|
|||
generator = model.generate
|
||||
return
|
||||
|
||||
if(utils.HAS_ACCELERATE):
|
||||
import breakmodel
|
||||
|
||||
if(utils.HAS_ACCELERATE):
|
||||
disk_blocks = breakmodel.disk_blocks
|
||||
gpu_blocks = breakmodel.gpu_blocks
|
||||
ram_blocks = len(utils.layers_module_names) - sum(gpu_blocks)
|
||||
|
|
Loading…
Reference in New Issue