mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-04-25 00:16:23 +02:00
Fix chunk params not converted (#549)
This commit is contained in:
parent
09930bdb86
commit
77fdec2c2d
2 changed files with 12 additions and 0 deletions
|
|
@ -76,6 +76,12 @@ class Processor(ChunkingService):
|
||||||
self.default_chunk_overlap
|
self.default_chunk_overlap
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Convert to int if they're strings (flow parameters are always strings)
|
||||||
|
if isinstance(chunk_size, str):
|
||||||
|
chunk_size = int(chunk_size)
|
||||||
|
if isinstance(chunk_overlap, str):
|
||||||
|
chunk_overlap = int(chunk_overlap)
|
||||||
|
|
||||||
# Create text splitter with effective parameters
|
# Create text splitter with effective parameters
|
||||||
text_splitter = RecursiveCharacterTextSplitter(
|
text_splitter = RecursiveCharacterTextSplitter(
|
||||||
chunk_size=chunk_size,
|
chunk_size=chunk_size,
|
||||||
|
|
|
||||||
|
|
@ -75,6 +75,12 @@ class Processor(ChunkingService):
|
||||||
self.default_chunk_overlap
|
self.default_chunk_overlap
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Convert to int if they're strings (flow parameters are always strings)
|
||||||
|
if isinstance(chunk_size, str):
|
||||||
|
chunk_size = int(chunk_size)
|
||||||
|
if isinstance(chunk_overlap, str):
|
||||||
|
chunk_overlap = int(chunk_overlap)
|
||||||
|
|
||||||
# Create text splitter with effective parameters
|
# Create text splitter with effective parameters
|
||||||
text_splitter = TokenTextSplitter(
|
text_splitter = TokenTextSplitter(
|
||||||
encoding_name="cl100k_base",
|
encoding_name="cl100k_base",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue