Hugging Face
Models
Datasets
Spaces
Posts
Docs
Enterprise
Pricing
Log In
Sign Up
Spaces:
slabstech
/
dhwani-internal-api-server
like
1
Paused
App
Files
Files
Community
Fetching metadata from the HF Docker repository...
6d4d57c
dhwani-internal-api-server
/
src
/
server
/
text.py
sachin
test-gemma-llm
475b0b9
about 1 month 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)]