Skip to content

Commit 926dcc6

Browse files
committed
update to pad tokens
1 parent 74fe45e commit 926dcc6

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/diffusers/pipelines/chroma/pipeline_chroma.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,14 @@ def _get_t5_prompt_embeds(
226226
return_overflowing_tokens=False,
227227
return_tensors="pt",
228228
)
229-
text_input_ids = text_inputs.input_ids + self.tokenizer.pad_token_id
229+
pad_token_id = self.tokenizer.pad_token_id
230+
text_input_ids = torch.cat(
231+
[
232+
text_inputs.input_ids,
233+
torch.full((text_inputs.input_ids.size(0), 1), pad_token_id, dtype=text_inputs.input_ids.dtype),
234+
],
235+
dim=1,
236+
)
230237

231238
prompt_embeds = self.text_encoder(
232239
text_input_ids.to(device),

0 commit comments

Comments
 (0)