ljsabc commited on
Commit
aafe9d9
1 Parent(s): 8d28c6d

Adapted to the final model; with advanced delimiter and cutoff.

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -79,13 +79,13 @@ def evaluate_stream(msg, history, temperature, top_p):
79
 
80
  # concatenate context
81
  for h in history[:-1]:
82
- context += h[0] + "\n" + h[1] + "\n"
83
 
84
  context += history[-1][0]
85
  context = context.replace(r'<br>', '')
86
 
87
  # TODO: Avoid the tokens are too long.
88
- CUTOFF = 208
89
  while len(tokenizer.encode(context)) > CUTOFF:
90
  # save 15 token size for the answer
91
  context = context[15:]
 
79
 
80
  # concatenate context
81
  for h in history[:-1]:
82
+ context += h[0] + "||" + h[1] + "||"
83
 
84
  context += history[-1][0]
85
  context = context.replace(r'<br>', '')
86
 
87
  # TODO: Avoid the tokens are too long.
88
+ CUTOFF = 224
89
  while len(tokenizer.encode(context)) > CUTOFF:
90
  # save 15 token size for the answer
91
  context = context[15:]