m-ric HF staff commited on
Commit
83f2644
β€’
1 Parent(s): aba583f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
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
- separators = separators_str[1:-1].replace("\\n", "\n").split(", ")
 
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"""