Skip to content

How to handle prompts longer than 77 tokens? (CLIP Token indices sequence length error) #20

Description

@pean1128

Hi, thank you for your great work!

I encountered the following error when running the code with a long prompt:
Token indices sequence length is longer than the specified maximum sequence length for this model (263 > 77). Running this sequence through the model will result in indexing errors The following part of your input was truncated because CLIP can only handle sequences up to 77 tokens:
It seems that CLIP only supports prompts up to 77 tokens, and my input prompt is much longer than that.

Could you please advise on how to handle prompts that exceed this limit?

Is there a recommended way to truncate, split, or otherwise process longer prompts so that the model can still work effectively?

Thank you in advance for your help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions