Fix separator escaping in CharacterTextSplitterComponent
This commit is contained in:
parent
dc055c5ee6
commit
d965040478
1 changed files with 2 additions and 0 deletions
|
|
@ -24,6 +24,8 @@ class CharacterTextSplitterComponent(CustomComponent):
|
||||||
chunk_size: int = 1000,
|
chunk_size: int = 1000,
|
||||||
separator: str = "\n",
|
separator: str = "\n",
|
||||||
) -> List[Document]:
|
) -> List[Document]:
|
||||||
|
# separator may come escaped from the frontend
|
||||||
|
separator = separator.encode().decode("unicode_escape")
|
||||||
docs = CharacterTextSplitter(
|
docs = CharacterTextSplitter(
|
||||||
chunk_overlap=chunk_overlap,
|
chunk_overlap=chunk_overlap,
|
||||||
chunk_size=chunk_size,
|
chunk_size=chunk_size,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue