xu song commited on
Commit
d5cbb86
·
1 Parent(s): df2bf3e
Files changed (1) hide show
  1. models/cpp_qwen2.py +4 -2
models/cpp_qwen2.py CHANGED
@@ -197,10 +197,12 @@ class Qwen2Simulator(Simulator):
197
  else:
198
  logger.info(f'finish_reason {stream["choices"][0]["finish_reason"]} with text: {stream["choices"][0]["text"]}')
199
 
200
- # warmup for next turn
201
  if suffix_tokens:
202
  # <|im_end|>\n
203
- self.llm.eval([151645, 198] + suffix_tokens) # 增加 n_tokens
 
 
204
 
205
 
206
 
 
197
  else:
198
  logger.info(f'finish_reason {stream["choices"][0]["finish_reason"]} with text: {stream["choices"][0]["text"]}')
199
 
200
+ # warmup for next turn (下轮解码的加速)
201
  if suffix_tokens:
202
  # <|im_end|>\n
203
+ logger.info(f"before warmup: n_tokens = {self.llm.n_tokens}")
204
+ self.llm.eval([151645, 198] + suffix_tokens) # 增加 n_tokens
205
+ logger.info(f"after warmup: n_tokens = {self.llm.n_tokens}")
206
 
207
 
208