make it not break on empty inputs; thank you tarded, we are

This commit is contained in:
AUTOMATIC 2023-01-07 07:22:07 +03:00
parent 79e39fae61
commit 08066676a4

View file

@ -147,7 +147,7 @@ class FrozenCLIPEmbedderWithCustomWordsBase(torch.nn.Module):
chunk.multipliers += [weight] * emb_len
position += embedding_length_in_tokens
if len(chunk.tokens) > 0:
if len(chunk.tokens) > 0 or len(chunks) == 0:
next_chunk()
return chunks, token_count