Skip to content

Commit

Permalink
IL-283 added ChunkOverlapTask defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
FelixFehseTNG committed Feb 29, 2024
1 parent 4be3230 commit fc9c52e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/intelligence_layer/core/chunk.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ class ChunkOverlapTask(Task[ChunkInput, ChunkOutput]):

def __init__(
self,
model: ControlModel,
max_tokens_per_chunk: int,
overlap_length_tokens: int,
model: ControlModel | None = None,
max_tokens_per_chunk: int = 512,
overlap_length_tokens: int = 0,
):
super().__init__()
if overlap_length_tokens >= max_tokens_per_chunk:
Expand All @@ -93,8 +93,10 @@ def __init__(
overlap_length_tokens, max_tokens_per_chunk
)
)
self.chunk_task = ChunkTask(model, overlap_length_tokens // 2)

model = model or LuminousControlModel()
self.tokenizer = model.get_tokenizer()
self.chunk_task = ChunkTask(model, overlap_length_tokens // 2)
self.max_tokens_per_chunk = max_tokens_per_chunk
self.overlap_length_tokens = overlap_length_tokens

Expand Down

0 comments on commit fc9c52e

Please sign in to comment.