NvidiaDocumentEmbedder Failed to query embedding endpoint: Error - "message":"Input length 616 exceeds maximum allowed token size 512" #8945
-
when I run NvidiaDocumentEmbedder , it gives me the following error even though I use a Document splitter to split my text inputs to only 200 words and also truncate them to make sure they never exceed 512 tokens. Anybody faced the same issue?
here is my code:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
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. |
Beta Was this translation helpful? Give feedback.
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