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
Running Functionary 2.4 Small.
The response from the API server endpoint should contain correct values for completion_tokens and total_tokens.
completion_tokens
total_tokens
completion_tokens is always 1. E.g.:
"usage": { "prompt_tokens": 507, "completion_tokens": 1, "total_tokens": 508 }
MacOS 14.4.1 MBP M3 Max
Darwin MacBook-Pro 23.4.0 Darwin Kernel Version 23.4.0: Fri Mar 15 00:12:37 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T6031 arm64
Python 3.11.5
completion_tokens always 1 with API server
Run
python3 -m llama_cpp.server --model "./functionary/functionary-small-v2.4.Q4_0.gguf" --chat_format functionary-v2 --hf_pretrained_model_name_or_path "./functionary" --n_gpu_layers -1
Then send an Open AI Tools calling request to the endpoint, something like:
curl http://localhost:8000/v1/chat/completions \ -H "Content-Type: application/json" \ -d '{ "messages": [ { "role": "user", "content": "What is the weather like in Boston?" } ], "tools": [ { "type": "function", "function": { "name": "get_current_weather", "description": "Get the current weather in a given location", "parameters": { "type": "object", "properties": { "location": { "type": "string", "description": "The city and state, e.g. San Francisco, CA" }, "unit": { "type": "string", "enum": ["celsius", "fahrenheit"] } }, "required": ["location"] } } } ], "tool_choice": "auto" }'
The response contains the wrong values for usage:
usage
"usage" : { "completion_tokens" : 1, "prompt_tokens" : 187, "total_tokens" : 188 }
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Prerequisites
Expected Behavior
Running Functionary 2.4 Small.
The response from the API server endpoint should contain correct values for
completion_tokens
andtotal_tokens
.Current Behavior
completion_tokens
is always 1. E.g.:Environment and Context
MacOS 14.4.1
MBP M3 Max
Darwin MacBook-Pro 23.4.0 Darwin Kernel Version 23.4.0: Fri Mar 15 00:12:37 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T6031 arm64
Python 3.11.5
Failure Information (for bugs)
completion_tokens
always 1 with API serverSteps to Reproduce
Run
python3 -m llama_cpp.server --model "./functionary/functionary-small-v2.4.Q4_0.gguf" --chat_format functionary-v2 --hf_pretrained_model_name_or_path "./functionary" --n_gpu_layers -1
Then send an Open AI Tools calling request to the endpoint, something like:
The response contains the wrong values for
usage
:The text was updated successfully, but these errors were encountered: