We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
response = client.chat.completions.create( model=model_name, messages=[ # {"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": msg_clean}, ], temperature=0.8, top_p=0.8, max_tokens=2048, stream=True, stream_options={"include_usage": True}, )
参考 建议在llamafactory/api/chat.py 第144行左右create_stream_chat_completion_response 函数下 _create_stream_chat_completion_chunk 对stream_options 处理
计算steam=True时,通过stream_options={"include_usage": True}, 获取流式tokens 详细请参考
No response
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Reminder
Reproduction
参考
建议在llamafactory/api/chat.py 第144行左右create_stream_chat_completion_response 函数下
_create_stream_chat_completion_chunk 对stream_options 处理
Expected behavior
计算steam=True时,通过stream_options={"include_usage": True}, 获取流式tokens
详细请参考
System Info
No response
Others
No response
The text was updated successfully, but these errors were encountered: