Fix issue where text encoder was not fully unloaded in some instances

This commit is contained in:
Jaret Burkett
2025-11-19 09:01:00 -07:00
parent 26e4b71b57
commit 50e5d99545

View File

@@ -47,6 +47,7 @@ def unload_text_encoder(model: "BaseModel"):
if hasattr(pipe, "text_encoder"):
te = FakeTextEncoder(device=model.device_torch, dtype=model.torch_dtype)
text_encoder_list.append(te)
pipe.text_encoder.to('cpu')
pipe.text_encoder = te
i = 2