mirror of
https://github.com/ostris/ai-toolkit.git
synced 2026-05-01 03:31:35 +00:00
Fix issue where text encoder was not fully unloaded in some instances
This commit is contained in:
@@ -47,6 +47,7 @@ def unload_text_encoder(model: "BaseModel"):
|
|||||||
if hasattr(pipe, "text_encoder"):
|
if hasattr(pipe, "text_encoder"):
|
||||||
te = FakeTextEncoder(device=model.device_torch, dtype=model.torch_dtype)
|
te = FakeTextEncoder(device=model.device_torch, dtype=model.torch_dtype)
|
||||||
text_encoder_list.append(te)
|
text_encoder_list.append(te)
|
||||||
|
pipe.text_encoder.to('cpu')
|
||||||
pipe.text_encoder = te
|
pipe.text_encoder = te
|
||||||
|
|
||||||
i = 2
|
i = 2
|
||||||
|
|||||||
Reference in New Issue
Block a user