aaabiao commited on
Commit
38e817c
1 Parent(s): 838a931

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -56,7 +56,12 @@ def generate(
56
  outputs = []
57
  for text in streamer:
58
  outputs.append(text)
59
- yield "".join(outputs)
 
 
 
 
 
60
 
61
  chat_interface = gr.ChatInterface(
62
  fn=generate,
 
56
  outputs = []
57
  for text in streamer:
58
  outputs.append(text)
59
+ generated_text = "".join(outputs)
60
+ if "<s>" in generated_text:
61
+ yield generated_text[:generated_text.index("<s>")+3]
62
+ break
63
+ yield generated_text
64
+
65
 
66
  chat_interface = gr.ChatInterface(
67
  fn=generate,