Norod78 commited on
Commit
0a3b879
1 Parent(s): 9e96195

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
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 early_stop_pattern 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 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(