mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-08-18 09:36:38 +08:00
zero-vector placeholders
This commit is contained in:
parent
0f7b153f41
commit
6bdbac1c00
@ -226,8 +226,8 @@ class SDClipModel(torch.nn.Module, ClipTokenWeightEncoder):
|
||||
# For output embeddings, store their position and data for later.
|
||||
# Insert placeholder tokens to maintain sequence length.
|
||||
output_embeds_for_prompt.append((index, y["data"]))
|
||||
tokens_temp.extend([self.special_tokens["pad"]] * num_tokens_in_embed)
|
||||
attention_mask.extend([1] * num_tokens_in_embed)
|
||||
placeholder_data = torch.zeros_like(y["data"])
|
||||
other_embeds.append((index, {"type": "embedding", "data": placeholder_data}))
|
||||
else: # Regular input embedding
|
||||
other_embeds.append((index, y))
|
||||
index += num_tokens_in_embed
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user