refactor adapter hparam

This commit is contained in:
hiyouga
2023-12-15 20:53:11 +08:00
parent d4c351f1ec
commit 0716f5e470
21 changed files with 302 additions and 311 deletions

View File

@@ -47,7 +47,7 @@ def gen_cmd(args: Dict[str, Any]) -> str:
current_devices = os.environ.get("CUDA_VISIBLE_DEVICES", "0")
cmd_lines = ["CUDA_VISIBLE_DEVICES={} python src/train_bash.py ".format(current_devices)]
for k, v in args.items():
if v is not None and v != "":
if v is not None and v is not False and v != "":
cmd_lines.append(" --{} {} ".format(k, str(v)))
cmd_text = "\\\n".join(cmd_lines)
cmd_text = "```bash\n{}\n```".format(cmd_text)