Fix issue where text encoder was not fully unloaded in some instances
This commit is contained in:
1 parent
26e4b71b57
commit
50e5d99545
1 file changed
+1
@@ -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