BigSalmon commited on
Commit
b4c807e
1 Parent(s): a2cb5b0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -17,7 +17,11 @@ def run_generate(bad_words):
17
  for bad_word in bad_words:
18
  bad_word = " " + bad_word
19
  ids = tokenizer(bad_word).input_ids
 
 
20
  bad_word_ids.append(ids)
 
 
21
  print(bad_word_ids)
22
  return bad_word_ids
23
 
 
17
  for bad_word in bad_words:
18
  bad_word = " " + bad_word
19
  ids = tokenizer(bad_word).input_ids
20
+ ids = str(ids)
21
+ ids = ids.replace("]", ": -30").replace("[", "")
22
  bad_word_ids.append(ids)
23
+ bad_word_ids = str(bad_word_ids)
24
+ bad_word_ids = bad_word_ids.replace("['", "{").replace("']", "}").replace("'", "")
25
  print(bad_word_ids)
26
  return bad_word_ids
27