feat(chat_completion): 不生成到stop以使max_tokens参数生效

This commit is contained in:
RockChinQ
2023-08-01 10:26:23 +08:00
parent cba6aab48d
commit 0b854bdcf1

View File

@@ -87,7 +87,7 @@ class ChatCompletionRequest(RequestBase):
choice0 = resp["choices"][0] choice0 = resp["choices"][0]
# 如果不是函数调用且finish_reason为stop则停止迭代 # 如果不是函数调用且finish_reason为stop则停止迭代
if 'function_call' not in choice0['message'] and choice0["finish_reason"] == "stop": if 'function_call' not in choice0['message']: # and choice0["finish_reason"] == "stop"
self.stopped = True self.stopped = True
if 'function_call' in choice0['message']: if 'function_call' in choice0['message']: