Skip to content

Commit

Permalink
chore: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
simjak committed Jul 19, 2024
1 parent 6817a74 commit 1dde3e0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions semantic_chunkers/chunkers/regex.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ def __call__(self, docs: list[str]) -> List[List[Chunk]]:
current_chunk.token_count = 0

current_chunk.splits.append(sentence)
if current_chunk.token_count is None:
current_chunk.token_count = 0
current_chunk.token_count += sentence_token_count

# Last chunk
Expand Down
2 changes: 1 addition & 1 deletion semantic_chunkers/splitters/regex.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class RegexSplitter(BaseSplitter):
def __call__(
self, doc: str, delimiters: List[Union[str, regex.Pattern]] = []
) -> List[str]:
if not delimiters:
if not delimiters:
compiled_pattern = regex.compile(self.regex_pattern)
delimiters.append(compiled_pattern)
sentences = [doc]
Expand Down

0 comments on commit 1dde3e0

Please sign in to comment.