FAET: SPEEDUP CHUKING & SEPERATOR BASED CHUNKING #47
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hey, so this PR's got two main changes:
We're now converting docs to tokens in bulk, which is giving us a sweet 3X speed boost when dealing with a ton of docs (we tested it with 30k) by
chunking_by_token_size
. It's not gonna make much difference for small-scale stuff, but 30k is still pretty much toy-level (both industry and research usually work with way more). So yeah, this is definitely a solid upgrade.We've added support for separator-based splitting without needing any extra dependencies. This splitting method tries to keep the grammar structure intact, meaning you'll always get complete clauses or sentences without any overlap. We tweaked the logic from langchain, so it might not be exactly the same, but it does what it says on the tin.