Skip to content

Commit 807c8ac

Browse files
committed
Fix enable_sequential_cpu_offload in CogView4Pipeline
1 parent d8c617c commit 807c8ac

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/diffusers/pipelines/cogview4/pipeline_cogview4.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,7 @@ def _get_glm_embeds(
213213
device=text_input_ids.device,
214214
)
215215
text_input_ids = torch.cat([pad_ids, text_input_ids], dim=1)
216-
prompt_embeds = self.text_encoder(
217-
text_input_ids.to(self.text_encoder.device), output_hidden_states=True
218-
).hidden_states[-2]
216+
prompt_embeds = self.text_encoder(text_input_ids.to(device), output_hidden_states=True).hidden_states[-2]
219217

220218
prompt_embeds = prompt_embeds.to(dtype=dtype, device=device)
221219
return prompt_embeds

0 commit comments

Comments
 (0)