Remove vision model from qwen text encoder as it is not needed for image generation currently
This commit is contained in:
1 parent
14ccf2f3ce
commit
4c4a10d439
1 file changed
+4
@@ -130,6 +130,10 @@ class QwenImageModel(BaseModel):
|
|||||||
text_encoder = Qwen2_5_VLForConditionalGeneration.from_pretrained(
|
text_encoder = Qwen2_5_VLForConditionalGeneration.from_pretrained(
|
||||||
base_model_path, subfolder="text_encoder", torch_dtype=dtype
|
base_model_path, subfolder="text_encoder", torch_dtype=dtype
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# remove the visual model as it is not needed for image generation
|
||||||
|
text_encoder.model.visual = None
|
||||||
|
|
||||||
text_encoder.to(self.device_torch, dtype=dtype)
|
text_encoder.to(self.device_torch, dtype=dtype)
|
||||||
flush()
|
flush()
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user