Update app.py
Browse files
app.py
CHANGED
@@ -25,10 +25,11 @@ def generate(text = ""):
|
|
25 |
for new_text in streamer:
|
26 |
yield generated_text + new_text
|
27 |
generated_text += new_text
|
28 |
-
if
|
29 |
generated_text = generated_text[: generated_text.find(tok.eos_token) if tok.eos_token else None]
|
30 |
streamer.end()
|
31 |
yield generated_text
|
|
|
32 |
return generated_text
|
33 |
|
34 |
demo = gr.Interface(
|
|
|
25 |
for new_text in streamer:
|
26 |
yield generated_text + new_text
|
27 |
generated_text += new_text
|
28 |
+
if tok.eos_token in generated_text:
|
29 |
generated_text = generated_text[: generated_text.find(tok.eos_token) if tok.eos_token else None]
|
30 |
streamer.end()
|
31 |
yield generated_text
|
32 |
+
return
|
33 |
return generated_text
|
34 |
|
35 |
demo = gr.Interface(
|