Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -6,7 +6,10 @@ from langchain.text_splitter import (
|
|
6 |
|
7 |
|
8 |
def chunk(text, length, splitter_selection, separators_str):
|
9 |
-
|
|
|
|
|
|
|
10 |
if splitter_selection == "LangChain's CharacterTextSplitter":
|
11 |
text_splitter = CharacterTextSplitter(
|
12 |
separator="",
|
|
|
6 |
|
7 |
|
8 |
def chunk(text, length, splitter_selection, separators_str):
|
9 |
+
# Extract list of separators from the string
|
10 |
+
separators = separators_str[1:-1].split(", ")
|
11 |
+
separators = [separator.replace('"', "").replace("'", "") for separator in separators]
|
12 |
+
|
13 |
if splitter_selection == "LangChain's CharacterTextSplitter":
|
14 |
text_splitter = CharacterTextSplitter(
|
15 |
separator="",
|