aboutsummaryrefslogtreecommitdiff
path: root/tests/test_chunking.py
diff options
context:
space:
mode:
authorhistoria <historiavg@proton.me>2026-08-19 02:10:13 -0400
committerhistoria <historiavg@proton.me>2026-08-19 02:10:13 -0400
commit11384921323f7b08271be0607d8df774489a1f7d (patch)
tree90b78855cce256dea077ed72dd822ae1fbb1696f /tests/test_chunking.py
parenta89daa1af05e2816f970d6a7b28a07df4f102f7d (diff)
downloadtts-audiobook-generator-11384921323f7b08271be0607d8df774489a1f7d.tar.gz
fix: reduce chunk size to 40
Diffstat (limited to 'tests/test_chunking.py')
-rw-r--r--tests/test_chunking.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/test_chunking.py b/tests/test_chunking.py
index 659a771..d1d95bd 100644
--- a/tests/test_chunking.py
+++ b/tests/test_chunking.py
@@ -2,9 +2,19 @@
import unittest
+from converter import config
from converter.chunking import split_into_chunks
+class ChunkSizeDefaultTests(unittest.TestCase):
+ """Guard the default chunk size: each API call is one model generation,
+ and long single generations lose prosody, can turn garbled, and are
+ truncated at the model's token limit (text past it is never spoken)."""
+
+ def test_default_chunk_size_within_single_generation_budget(self):
+ self.assertLessEqual(config.CHUNK_SIZE_WORDS, 60)
+
+
class SplitIntoChunksTests(unittest.TestCase):
def test_empty_input(self):
self.assertEqual(split_into_chunks(""), [])