Skip to content

NvidiaDocumentEmbedder Failed to query embedding endpoint: Error - "message":"Input length 616 exceeds maximum allowed token size 512" #8945

Answered by julian-risch
smmhsnn asked this question in Questions

You must be logged in to vote

Hello @smmhsnn thanks for sharing the code you used. From the initialization of the DocumentSplitter, I can see that you are splitting by word with a limit of 200. That means texts longer than 200 words will be split up into multiple documents. However, even a text with less than 200 words, for example 150 words, can result in more than 200 tokens as some words consist of multiple tokens.
What you could try is set the split_length to an even lower number in your DocumentSplitter or try to identify, which particular document is resulting in so many tokens.
We have an open issue for a preprocessor component that takes the number of tokens into account: #4392

Replies: 1 comment 1 reply

You must be logged in to vote
1 reply
@smmhsnn

Answer selected by julian-risch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants