raptor icon indicating copy to clipboard operation
raptor copied to clipboard

Bug in chunk splitting

Open Giustino98 opened this issue 9 months ago • 1 comments

I have been struggling with method RA.add_documents() with Azure OpenAI since it returned: Error: 400 ‘$.input’ is invalid. I found the problem was due to split_text() function in utils.py since it, in some situations, could return empty chunk which would give error when sent to openai. To fix this, I just added the following line of code: chunks = [chunk for chunk in chunks if chunk.strip()] in build_from_text method of tree_builder.py

Giustino98 avatar May 14 '24 11:05 Giustino98