From d57f70bf8a1996c038baa45c14635088e0cf2071 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: 8b912690e34b040b98c4eac5eef5c56876345b1d --- 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: