Spaces:
Build error
Build error
Download utils.py from GirishaBuilds01/esg-multimodal-intelligence: direct link, hf CLI and curl.
- Browser
- Download file 287 Bytes
-
https://huggingface.co/spaces/GirishaBuilds01/esg-multimodal-intelligence/resolve/main/utils.py
- Command line
-
hf download hf://spaces/GirishaBuilds01/esg-multimodal-intelligence/utils.py
-
curl -L -o utils.py https://huggingface.co/spaces/GirishaBuilds01/esg-multimodal-intelligence/resolve/main/utils.py
287 Bytes
| def chunk_text(text, chunk_size=400, overlap=80): | |
| chunks = [] | |
| start = 0 | |
| text_length = len(text) | |
| while start < text_length: | |
| end = min(start + chunk_size, text_length) | |
| chunks.append(text[start:end]) | |
| start += chunk_size - overlap | |
| return chunks | |