Update main.py
Browse files
main.py
CHANGED
@@ -54,7 +54,7 @@ def generate(prompt, history, temperature=0.9, max_new_tokens=512, top_p=0.95, r
|
|
54 |
word += decoded_text
|
55 |
|
56 |
# If the token is a space or the end of the stream, add the word to the output and reset the word
|
57 |
-
if token_text == " " or response.
|
58 |
output += word + " "
|
59 |
word = ""
|
60 |
|
|
|
54 |
word += decoded_text
|
55 |
|
56 |
# If the token is a space or the end of the stream, add the word to the output and reset the word
|
57 |
+
if token_text == " " or response.is_end_of_stream:
|
58 |
output += word + " "
|
59 |
word = ""
|
60 |
|