Startup OOM fix (optimized)

Prevent model from being loaded into VRAM at startup in optimized mode (causes OOM)
This commit is contained in:
oobabooga 2022-08-30 10:00:01 -03:00 committed by hlky
parent 7ad5c4ecd8
commit fe173407fe

View File

@ -357,7 +357,8 @@ if opt.optimized:
model = instantiate_from_config(config.modelUNet)
_, _ = model.load_state_dict(sd, strict=False)
model.cuda()
if not opt.optimized:
model.cuda()
model.eval()
model.turbo = opt.optimized_turbo