From 189346188be36b15c5043d3fa35d3c16b8f263bc Mon Sep 17 00:00:00 2001 From: zhaonx96 <953608703@qq,com> Date: Mon, 6 May 2024 10:10:00 +0800 Subject: [PATCH] =?UTF-8?q?=E2=80=9Dadd=20stop=20parameter=20in=20chat.py?= =?UTF-8?q?=E2=80=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Former-commit-id: 80645751bc4db20dbadb53950fe35af8b67eec41 --- src/llmtuner/api/chat.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/llmtuner/api/chat.py b/src/llmtuner/api/chat.py index fa2f0d03..972ee906 100644 --- a/src/llmtuner/api/chat.py +++ b/src/llmtuner/api/chat.py @@ -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(