From 7984ae8b629cce831214e36090efc31e9739d51d Mon Sep 17 00:00:00 2001 From: hiyouga Date: Sat, 12 Aug 2023 23:52:07 +0800 Subject: [PATCH] fix webui Former-commit-id: d69b1388e61e5e867ec5c9a9a223677c5b5860ce --- src/llmtuner/webui/components/top.py | 2 +- src/llmtuner/webui/runner.py | 4 +--- src/llmtuner/webui/utils.py | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/llmtuner/webui/components/top.py b/src/llmtuner/webui/components/top.py index 77d60593..97a332c1 100644 --- a/src/llmtuner/webui/components/top.py +++ b/src/llmtuner/webui/components/top.py @@ -26,7 +26,7 @@ def create_top() -> Dict[str, "Component"]: with gr.Accordion(label="Advanced config", open=False) as advanced_tab: with gr.Row(): - quantization_bit = gr.Dropdown([8, 4], scale=1) + quantization_bit = gr.Dropdown(["", "8", "4"], scale=1) template = gr.Dropdown(value="default", choices=list(templates.keys()), scale=1) source_prefix = gr.Textbox(scale=2) diff --git a/src/llmtuner/webui/runner.py b/src/llmtuner/webui/runner.py index aab31349..3a28dae6 100644 --- a/src/llmtuner/webui/runner.py +++ b/src/llmtuner/webui/runner.py @@ -126,8 +126,6 @@ class Runner: logging_steps=logging_steps, save_steps=save_steps, warmup_steps=warmup_steps, - fp16=(compute_type == "fp16"), - bf16=(compute_type == "bf16"), padding_side=padding_side, lora_rank=lora_rank, lora_dropout=lora_dropout, @@ -135,7 +133,7 @@ class Runner: resume_lora_training=resume_lora_training, output_dir=output_dir ) - + args[compute_type] = True if val_size > 1e-6: args["val_size"] = val_size args["evaluation_strategy"] = "steps" diff --git a/src/llmtuner/webui/utils.py b/src/llmtuner/webui/utils.py index 6ca55e14..168fbe43 100644 --- a/src/llmtuner/webui/utils.py +++ b/src/llmtuner/webui/utils.py @@ -65,7 +65,7 @@ def can_quantize(finetuning_type: str) -> Dict[str, Any]: def gen_cmd(args: Dict[str, Any]) -> str: cmd_lines = ["CUDA_VISIBLE_DEVICES=0 python "] for k, v in args.items(): - if v is not None and v is not False and v != "": + if v is not None and v != "": cmd_lines.append(" --{} {} ".format(k, str(v))) cmd_text = "\\\n".join(cmd_lines) cmd_text = "```bash\n{}\n```".format(cmd_text)