Spaces:
Sleeping
Sleeping
Download app/utils/chunking.py from thabsheeeeeer/DocBrain-API: direct link, hf CLI and curl.
- Browser
- Download file 232 Bytes
-
https://huggingface.co/spaces/thabsheeeeeer/DocBrain-API/resolve/main/app/utils/chunking.py
- Command line
-
hf download hf://spaces/thabsheeeeeer/DocBrain-API/app/utils/chunking.py
-
curl -L -o chunking.py https://huggingface.co/spaces/thabsheeeeeer/DocBrain-API/resolve/main/app/utils/chunking.py
232 Bytes
| from langchain_text_splitters import RecursiveCharacterTextSplitter | |
| def chunk_text(text): | |
| splitter = RecursiveCharacterTextSplitter( | |
| chunk_size=800, | |
| chunk_overlap=150 | |
| ) | |
| return splitter.split_text(text) |