ljsabc commited on
Commit
1cfb8e6
1 Parent(s): fb89707

Fixed a bug for encoder.

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -86,7 +86,7 @@ def evaluate_stream(msg, history, temperature, top_p):
86
 
87
  # TODO: Avoid the tokens are too long.
88
  CUTOFF = 160
89
- while tokenizer.encode(context) > CUTOFF:
90
  # save 15 token size for the answer
91
  context = context[15:]
92
 
 
86
 
87
  # TODO: Avoid the tokens are too long.
88
  CUTOFF = 160
89
+ while len(tokenizer.encode(context)) > CUTOFF:
90
  # save 15 token size for the answer
91
  context = context[15:]
92