Hugging Face
Models
Datasets
Spaces
Posts
Docs
Enterprise
Pricing
Log In
Sign Up
Spaces:
slabstech
/
dhwani-server
like
0
Running
on
CPU Upgrade
App
Files
Files
Community
Fetching metadata from the HF Docker repository...
7226c84
dhwani-server
/
src
/
server
/
utils
/
text.py
sachin
init-asr
9781b82
24 days 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)]