Skip to content

Commit

Permalink
chore: Python 3.9 support
Browse files Browse the repository at this point in the history
  • Loading branch information
simjak committed Jul 19, 2024
1 parent 54a65ff commit dfb2713
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions semantic_chunkers/chunkers/base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Any, List
from typing import Any, List, Optional

from colorama import Fore, Style
from pydantic.v1 import BaseModel, Extra
Expand All @@ -10,7 +10,7 @@

class BaseChunker(BaseModel):
name: str
encoder: BaseEncoder | None
encoder: Optional[BaseEncoder]
splitter: BaseSplitter

class Config:
Expand Down
4 changes: 2 additions & 2 deletions semantic_chunkers/chunkers/statistical.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import asyncio
from dataclasses import dataclass
from typing import Any, List
from typing import Any, List, Optional

import numpy as np
from semantic_router.encoders.base import BaseEncoder
Expand Down Expand Up @@ -106,7 +106,7 @@ def _chunk(
splits = [split for split in new_splits if split and split.strip()]

chunks = []
last_chunk: Chunk | None = None
last_chunk: Optional[Chunk] = None
for i in tqdm(range(0, len(splits), batch_size)):
batch_splits = splits[i : i + batch_size]
if last_chunk is not None:
Expand Down

0 comments on commit dfb2713

Please sign in to comment.