mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-01-11 02:15:17 +00:00
Ignore embeddings when sizes don't match and print a WARNING.
This commit is contained in:
parent
5036fecbdd
commit
1718730e80
@ -74,9 +74,12 @@ class SD1ClipModel(torch.nn.Module, ClipTokenWeightEncoder):
|
|||||||
if isinstance(y, int):
|
if isinstance(y, int):
|
||||||
tokens_temp += [y]
|
tokens_temp += [y]
|
||||||
else:
|
else:
|
||||||
embedding_weights += [y]
|
if y.shape[0] == current_embeds.weight.shape[1]:
|
||||||
tokens_temp += [next_new_token]
|
embedding_weights += [y]
|
||||||
next_new_token += 1
|
tokens_temp += [next_new_token]
|
||||||
|
next_new_token += 1
|
||||||
|
else:
|
||||||
|
print("WARNING: shape mismatch when trying to apply embedding, embedding will be ignored", y.shape[0], current_embeds.weight.shape[1])
|
||||||
out_tokens += [tokens_temp]
|
out_tokens += [tokens_temp]
|
||||||
|
|
||||||
if len(embedding_weights) > 0:
|
if len(embedding_weights) > 0:
|
||||||
|
Loading…
Reference in New Issue
Block a user