From dab8f450336ce857cc1dab534ab91e1f7d7b1ee2 Mon Sep 17 00:00:00 2001 From: hiyouga Date: Wed, 1 Nov 2023 23:07:58 +0800 Subject: [PATCH] fix chat Former-commit-id: 68f2b3df09c4c8638b9e225fd5b8aed3541e97a0 --- src/llmtuner/chat/stream_chat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/llmtuner/chat/stream_chat.py b/src/llmtuner/chat/stream_chat.py index 938e9bcc..cc815d1b 100644 --- a/src/llmtuner/chat/stream_chat.py +++ b/src/llmtuner/chat/stream_chat.py @@ -53,7 +53,7 @@ class ChatModel: pad_token_id=self.tokenizer.pad_token_id )) - if int(num_return_sequences) > 1: + if isinstance(num_return_sequences, int) and num_return_sequences > 1: generating_args["do_sample"] = True if max_length: