Merge commit from fork

[patch] Patch remote OS command injection vulnerability

Former-commit-id: b3aa80d54a67da45e9e237e349486fb9c162b2ac
This commit is contained in:
hoshi-hiyouga 2024-11-21 22:39:44 +08:00 committed by GitHub
commit 24419dd3f1

View File

@ -320,7 +320,7 @@ class Runner:
if args.get("deepspeed", None) is not None:
env["FORCE_TORCHRUN"] = "1"
self.trainer = Popen(f"llamafactory-cli train {save_cmd(args)}", env=env, shell=True)
self.trainer = Popen(["llamafactory-cli", "train", save_cmd(args)], env=env)
yield from self.monitor()
def _form_config_dict(self, data: Dict["Component", Any]) -> Dict[str, Any]: