Feat/add chunk size control arg (#56)

This pull request addresses issue #38 

**Changes included:**

- Added a `max_tokens` parameter to the typer cli for the `generate`
command, allowing user to set a default number of tokens per chunk.
- Introduced a default variable `MAX_TOKEN_PER_CHUNK` to centralize the
default value.
- Fixed a tokenization issue by inserting a comma, allowing the model to
correctly read each chunk as intended rather than treating one chunk as
a single sentence.

**Future improvement suggestion :**

- Consider enhancing the `split_into_best_sentences` function using
regex to split text more accurately without modifying it, which would
improve clarity and maintainability.

---------

Co-authored-by: Václav Volhejn <8401624+vvolhejn@users.noreply.github.com>
This commit is contained in:
Saleem Djima
2026-01-21 11:54:53 +01:00
committed by GitHub
co-authored by Václav Volhejn
parent 36f21a0a7f
commit 4ec89acf95
4 changed files with 16 additions and 4 deletions
+1
View File
@@ -5,3 +5,4 @@ DEFAULT_LSD_DECODE_STEPS = 1
DEFAULT_NOISE_CLAMP = None
DEFAULT_EOS_THRESHOLD = -4.0
DEFAULT_FRAMES_AFTER_EOS = None
MAX_TOKEN_PER_CHUNK = 50