”add stop parameter in chat.py“

This commit is contained in:
zhaonx96 2024-05-06 10:10:00 +08:00
parent 1abd55dd59
commit 80645751bc
1 changed files with 2 additions and 0 deletions

View File

@ -103,6 +103,7 @@ async def create_chat_completion_response(
top_p=request.top_p,
max_new_tokens=request.max_tokens,
num_return_sequences=request.n,
stop=request.stop
)
prompt_length, response_length = 0, 0
@ -155,6 +156,7 @@ async def create_stream_chat_completion_response(
temperature=request.temperature,
top_p=request.top_p,
max_new_tokens=request.max_tokens,
stop=request.stop
):
if len(new_token) != 0:
yield _create_stream_chat_completion_chunk(