Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -17,6 +17,7 @@ def length_tokens(txt):
|
|
| 17 |
|
| 18 |
|
| 19 |
def extract_separators_from_string(separators_str):
|
|
|
|
| 20 |
try:
|
| 21 |
separators = separators_str[1:-1].split(", ")
|
| 22 |
return [separator.replace('"', "").replace("'", "") for separator in separators]
|
|
@@ -33,9 +34,6 @@ def change_split_selection(split_selection):
|
|
| 33 |
)
|
| 34 |
|
| 35 |
def chunk(text, length, splitter_selection, separators_str, length_unit_selection, chunk_overlap):
|
| 36 |
-
print(f"Received chunk overlap: {chunk_overlap}")
|
| 37 |
-
print(f"Received chunk overlap: {chunk_overlap}")
|
| 38 |
-
print(f"Received chunk overlap: {chunk_overlap}")
|
| 39 |
separators = extract_separators_from_string(separators_str)
|
| 40 |
length_function = (length_tokens if "token" in length_unit_selection.lower() else len)
|
| 41 |
if splitter_selection == LABEL_TEXTSPLITTER:
|
|
|
|
| 17 |
|
| 18 |
|
| 19 |
def extract_separators_from_string(separators_str):
|
| 20 |
+
print('Received:', type(separators_str), 'with value', separators_str)
|
| 21 |
try:
|
| 22 |
separators = separators_str[1:-1].split(", ")
|
| 23 |
return [separator.replace('"', "").replace("'", "") for separator in separators]
|
|
|
|
| 34 |
)
|
| 35 |
|
| 36 |
def chunk(text, length, splitter_selection, separators_str, length_unit_selection, chunk_overlap):
|
|
|
|
|
|
|
|
|
|
| 37 |
separators = extract_separators_from_string(separators_str)
|
| 38 |
length_function = (length_tokens if "token" in length_unit_selection.lower() else len)
|
| 39 |
if splitter_selection == LABEL_TEXTSPLITTER:
|