From e0562521bbd7cf6b3b90f8c87e52690931f736bd Mon Sep 17 00:00:00 2001 From: marko1616 <45327989+marko1616@users.noreply.github.com> Date: Sat, 6 Jul 2024 20:40:13 +0800 Subject: [PATCH] Update utils.py In windows mutiline command should like command --arg1 xxx ` --arg2 xxx ` --- src/llamafactory/webui/utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/llamafactory/webui/utils.py b/src/llamafactory/webui/utils.py index 6e5fdbe4..80f53b6a 100644 --- a/src/llamafactory/webui/utils.py +++ b/src/llamafactory/webui/utils.py @@ -113,7 +113,10 @@ def gen_cmd(args: Dict[str, Any]) -> str: for k, v in clean_cmd(args).items(): cmd_lines.append(" --{} {} ".format(k, str(v))) - cmd_text = "\\\n".join(cmd_lines) + if os.name == "nt": + cmd_text = "`\n".join(cmd_lines) + else: + cmd_text = "\\\n".join(cmd_lines) cmd_text = "```bash\n{}\n```".format(cmd_text) return cmd_text