Open carbaj03 opened 1 year ago
This is a bug @Intex32, and I discussed it today, but that shows up in a different place. We must also ensure we chunk the text and send a request based on the model max allowed tokens. In this case, the text is being sent without chunking, or you have a configured a chunk size higher than the model max tokens.
Yes, today I had a look at this. addContext(String)
which is used here does not have any logic for chunking the String. In this case, the string is exceeding the token limit from the embedding model.
I looked at the PDF example where you can ask questions about a pdf file. This uses TokenTextSplitter
to split the text in chunk. Adding this here should fix it.
Is this an expected behavior? For me, when I try to load a file too big, this should be split into multiple embeddings and used for the current prompt.