Spaces:
Running
Running
Update run.py
Browse files
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
|
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 |
|