From 3743b7420b823c5a56aef6100121d89b677ffb0e Mon Sep 17 00:00:00 2001 From: hiyouga Date: Tue, 14 Nov 2023 15:27:05 +0800 Subject: [PATCH] fix #1489 --- src/cli_demo.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/cli_demo.py b/src/cli_demo.py index fe6a0bc4..cccda517 100644 --- a/src/cli_demo.py +++ b/src/cli_demo.py @@ -1,6 +1,12 @@ -import readline from llmtuner import ChatModel +try: + import platform + if platform.system() != "Windows": + import readline +except ImportError: + print("Install `readline` for a better experience.") + def main(): chat_model = ChatModel()