mirror of
https://github.com/theroyallab/tabbyAPI.git
synced 2026-03-14 15:57:27 +00:00
Bugfix: Chat completion requests fail with UnboundLocalError: finish_reason variable not initialized (#307)
* fix issue #306 * removed whitespaces for ruff
This commit is contained in:
committed by
GitHub
parent
d98c0bd3f6
commit
a20abe2d33
@@ -74,7 +74,9 @@ def _create_response(
|
||||
|
||||
logprob_response = ChatCompletionLogprobs(content=collected_token_probs)
|
||||
|
||||
# Finish reason will always be present in a completion
|
||||
# Initialize finish_reason with a default value or from generation data
|
||||
finish_reason = generation.get("finish_reason", "stop")
|
||||
|
||||
# If a tool call is present, mark the finish reason as such
|
||||
if message.tool_calls:
|
||||
finish_reason = "tool_calls"
|
||||
|
||||
Reference in New Issue
Block a user