Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -19,7 +19,8 @@ def length_tokens(txt):
|
|
19 |
def extract_separators_from_string(separators_str):
|
20 |
print('Received:', type(separators_str), 'with value', repr(separators_str))
|
21 |
try:
|
22 |
-
|
|
|
23 |
return [separator.replace('"', "").replace("'", "") for separator in separators]
|
24 |
except Exception as e:
|
25 |
raise gr.Error(f"""
|
|
|
19 |
def extract_separators_from_string(separators_str):
|
20 |
print('Received:', type(separators_str), 'with value', repr(separators_str))
|
21 |
try:
|
22 |
+
separators_str = separators_str.replace("\\n", "\n").replace("\\t", "\t") # fix special characters
|
23 |
+
separators = separators_str[1:-1].split(", ")
|
24 |
return [separator.replace('"', "").replace("'", "") for separator in separators]
|
25 |
except Exception as e:
|
26 |
raise gr.Error(f"""
|