StarFox7 commited on
Commit
7f786ac
Β·
1 Parent(s): 70f1aa8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -146,6 +146,10 @@ def bot(history):
146
  print(elm, end="", flush=True)
147
  # logger.debug(f"{elm}")
148
 
 
 
 
 
149
  response.append(elm)
150
  history[-1][1] = prefix + "".join(response).replace("▁"," ")
151
  yield history
 
146
  print(elm, end="", flush=True)
147
  # logger.debug(f"{elm}")
148
 
149
+ temp_str = "".join(response).replace("▁"," ")
150
+ if len(temp_str) > 2:
151
+ if temp_str[-2:] in stop_string:
152
+ break
153
  response.append(elm)
154
  history[-1][1] = prefix + "".join(response).replace("▁"," ")
155
  yield history