Hugging Face
Models
Datasets
Spaces
Community
Docs
Enterprise
Pricing
Log In
Sign Up
Spaces:
gaganyatri
/
ai4bharat-server
like
0
Paused
App
Files
Files
Community
Fetching metadata from the HF Docker repository...
a0887d0
ai4bharat-server
/
src
/
server
/
text.py
sachin
test-gemma-llm
475b0b9
6 months ago
raw
Copy download link
history
blame
Safe
175 Bytes
def
chunk_text
(
text:
str
, chunk_size:
int
=
15
) ->
list
[
str
]:
words = text.split()
return
[
' '
.join(words[i:i + chunk_size])
for
i
in
range
(
0
,
len
(words), chunk_size)]