aliabid94 HF staff commited on
Commit
8df66fe
1 Parent(s): c856bc9

Update run.py

Browse files
Files changed (1) hide show
  1. run.py +2 -1
run.py CHANGED
@@ -10,11 +10,12 @@ with open("wordlist.json") as wordlist_json:
10
 
11
 
12
  def autocomplete(text):
13
- end_text = " ".join(text.split(" ")[-30:-1])
14
  generated_text = generator(
15
  end_text, return_full_text=False, clean_up_tokenization_spaces=True
16
  )[0]["generated_text"]
17
  generated_text = generated_text.replace("\n", " ")
 
18
  return generated_text
19
 
20
 
 
10
 
11
 
12
  def autocomplete(text):
13
+ end_text = " ".join(text.split(" ")[-30])
14
  generated_text = generator(
15
  end_text, return_full_text=False, clean_up_tokenization_spaces=True
16
  )[0]["generated_text"]
17
  generated_text = generated_text.replace("\n", " ")
18
+ generated_text = " ".join(generated_text.split(" ")[:-1])
19
  return generated_text
20
 
21