Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: load chunker from config #270

Merged
merged 11 commits into from
Jul 17, 2023
Prev Previous commit
chore: linting
  • Loading branch information
cachho committed Jul 17, 2023
commit 8d8a0e51e02ea8ee37eeb44bbd815394735bdeba
4 changes: 1 addition & 3 deletions embedchain/chunkers/docx_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ class DocxFileChunker(BaseChunker):

def __init__(self, config: Optional[ChunkerConfig] = None):
if config is None:
config = ChunkerConfig(
chunk_size=1000, chunk_overlap=0, length_function=len
)
config = ChunkerConfig(chunk_size=1000, chunk_overlap=0, length_function=len)
text_splitter = RecursiveCharacterTextSplitter(
chunk_size=config.chunk_size,
chunk_overlap=config.chunk_overlap,
Expand Down
4 changes: 1 addition & 3 deletions embedchain/chunkers/pdf_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ class PdfFileChunker(BaseChunker):

def __init__(self, config: Optional[ChunkerConfig] = None):
if config is None:
config = ChunkerConfig(
chunk_size=1000, chunk_overlap=0, length_function=len
)
config = ChunkerConfig(chunk_size=1000, chunk_overlap=0, length_function=len)
text_splitter = RecursiveCharacterTextSplitter(
chunk_size=config.chunk_size,
chunk_overlap=config.chunk_overlap,
Expand Down
4 changes: 1 addition & 3 deletions embedchain/chunkers/youtube_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ class YoutubeVideoChunker(BaseChunker):

def __init__(self, config: Optional[ChunkerConfig] = None):
if config is None:
config = ChunkerConfig(
chunk_size=2000, chunk_overlap=0, length_function=len
)
config = ChunkerConfig(chunk_size=2000, chunk_overlap=0, length_function=len)
text_splitter = RecursiveCharacterTextSplitter(
chunk_size=config.chunk_size,
chunk_overlap=config.chunk_overlap,
Expand Down