We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6e8bf84 commit 6d671d2Copy full SHA for 6d671d2
1 file changed
chatglm_cpp/openai_api.py
@@ -209,7 +209,7 @@ def tool_call(**kwargs):
209
temperature=body.temperature,
210
)
211
logging.info(f'prompt: "{messages[-1].content}", sync response: "{output.content}"')
212
- prompt_tokens = len(pipeline.tokenizer.encode_messages(messages, max_context_length))
+ prompt_tokens = len(pipeline.tokenizer.apply_chat_template(messages, max_context_length))
213
completion_tokens = len(pipeline.tokenizer.encode(output.content, body.max_tokens))
214
215
finish_reason = "stop"
0 commit comments