Open fengwang opened 2 years ago
The clip-vit-large-patch14 (https://huggingface.co/openai/clip-vit-large-patch14) model used by SD can only handle sequences of 77 tokens. It works like that in the original pytorch implementation as well. Anything longer than that gets silently truncated.
The clip-vit-large-patch14 (https://huggingface.co/openai/clip-vit-large-patch14) model used by SD can only handle sequences of 77 tokens. It works like that in the original pytorch implementation as well. Anything longer than that gets silently truncated.
Thank you for the kind reply.
In this case, I would suggest truncating the the sequence to 77 tokens while giving a warning, instead of throw an assertion error from this place:
The clip-vit-large-patch14 (https://huggingface.co/openai/clip-vit-large-patch14) model used by SD can only handle sequences of 77 tokens. It works like that in the original pytorch implementation as well. Anything longer than that gets silently truncated.
Thank you for the kind reply.
In this case, I would suggest truncating the the sequence to 77 tokens while giving a warning, instead of throw an assertion error from this place:
Any tips on how to truncate or where to get started?
In a pipeline I replaced the pytorch version with this implementation, but found the maximum prompt is limited to 77. Is this a compromise for some reasons?