Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -22,10 +22,11 @@ def chunks_of_900(text, chunk_size=900):
|
|
| 22 |
chunks = []
|
| 23 |
current_chunk = ""
|
| 24 |
for sentence in sentences:
|
| 25 |
-
|
| 26 |
-
current_chunk
|
| 27 |
-
|
| 28 |
-
|
|
|
|
| 29 |
else:
|
| 30 |
chunks.append(current_chunk)
|
| 31 |
current_chunk = sentence
|
|
|
|
| 22 |
chunks = []
|
| 23 |
current_chunk = ""
|
| 24 |
for sentence in sentences:
|
| 25 |
+
if len(current_chunk + sentence) <= chunk_size:
|
| 26 |
+
if len(current_chunk)!=0:
|
| 27 |
+
current_chunk += " "+sentence
|
| 28 |
+
else:
|
| 29 |
+
current_chunk += sentence
|
| 30 |
else:
|
| 31 |
chunks.append(current_chunk)
|
| 32 |
current_chunk = sentence
|