m-ric HF staff commited on
Commit
5323f2f
1 Parent(s): e304b98

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -6,7 +6,10 @@ from langchain.text_splitter import (
6
 
7
 
8
  def chunk(text, length, splitter_selection, separators_str):
9
- separators = separators_str[1:-1].split(", ").replace('"', "").replace("'", "")
 
 
 
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="",