mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2025-08-04 12:42:51 +08:00
fix webui
Former-commit-id: d69b1388e61e5e867ec5c9a9a223677c5b5860ce
This commit is contained in:
parent
e1b43dfc7f
commit
7984ae8b62
@ -26,7 +26,7 @@ def create_top() -> Dict[str, "Component"]:
|
|||||||
|
|
||||||
with gr.Accordion(label="Advanced config", open=False) as advanced_tab:
|
with gr.Accordion(label="Advanced config", open=False) as advanced_tab:
|
||||||
with gr.Row():
|
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)
|
template = gr.Dropdown(value="default", choices=list(templates.keys()), scale=1)
|
||||||
source_prefix = gr.Textbox(scale=2)
|
source_prefix = gr.Textbox(scale=2)
|
||||||
|
|
||||||
|
@ -126,8 +126,6 @@ class Runner:
|
|||||||
logging_steps=logging_steps,
|
logging_steps=logging_steps,
|
||||||
save_steps=save_steps,
|
save_steps=save_steps,
|
||||||
warmup_steps=warmup_steps,
|
warmup_steps=warmup_steps,
|
||||||
fp16=(compute_type == "fp16"),
|
|
||||||
bf16=(compute_type == "bf16"),
|
|
||||||
padding_side=padding_side,
|
padding_side=padding_side,
|
||||||
lora_rank=lora_rank,
|
lora_rank=lora_rank,
|
||||||
lora_dropout=lora_dropout,
|
lora_dropout=lora_dropout,
|
||||||
@ -135,7 +133,7 @@ class Runner:
|
|||||||
resume_lora_training=resume_lora_training,
|
resume_lora_training=resume_lora_training,
|
||||||
output_dir=output_dir
|
output_dir=output_dir
|
||||||
)
|
)
|
||||||
|
args[compute_type] = True
|
||||||
if val_size > 1e-6:
|
if val_size > 1e-6:
|
||||||
args["val_size"] = val_size
|
args["val_size"] = val_size
|
||||||
args["evaluation_strategy"] = "steps"
|
args["evaluation_strategy"] = "steps"
|
||||||
|
@ -65,7 +65,7 @@ def can_quantize(finetuning_type: str) -> Dict[str, Any]:
|
|||||||
def gen_cmd(args: Dict[str, Any]) -> str:
|
def gen_cmd(args: Dict[str, Any]) -> str:
|
||||||
cmd_lines = ["CUDA_VISIBLE_DEVICES=0 python "]
|
cmd_lines = ["CUDA_VISIBLE_DEVICES=0 python "]
|
||||||
for k, v in args.items():
|
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_lines.append(" --{} {} ".format(k, str(v)))
|
||||||
cmd_text = "\\\n".join(cmd_lines)
|
cmd_text = "\\\n".join(cmd_lines)
|
||||||
cmd_text = "```bash\n{}\n```".format(cmd_text)
|
cmd_text = "```bash\n{}\n```".format(cmd_text)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user