m-ric HF staff commited on
Commit
2cf6dda
·
verified ·
1 Parent(s): 7a1b35e

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].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
+ raw_separators_str = r'{}'.format(separators_str)
23
+ separators = raw_separators_str[1:-1].split(", ")
24
  return [separator.replace('"', "").replace("'", "") for separator in separators]
25
  except Exception as e:
26
  raise gr.Error(f"""