mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2025-08-06 05:32:50 +08:00
fix webui val size
Former-commit-id: ad6e7c76c7b5590ea6ca55c4f76db2d3206b5987
This commit is contained in:
parent
0dc9b41b16
commit
58e95776e1
@ -38,7 +38,7 @@ def create_sft_tab(top_elems: Dict[str, "Component"], runner: "Runner") -> Dict[
|
|||||||
value="cosine", choices=[scheduler.value for scheduler in SchedulerType]
|
value="cosine", choices=[scheduler.value for scheduler in SchedulerType]
|
||||||
)
|
)
|
||||||
max_grad_norm = gr.Textbox(value="1.0")
|
max_grad_norm = gr.Textbox(value="1.0")
|
||||||
dev_ratio = gr.Slider(value=0, minimum=0, maximum=1, step=0.001)
|
val_size = gr.Slider(value=0, minimum=0, maximum=1, step=0.001)
|
||||||
|
|
||||||
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():
|
||||||
@ -88,7 +88,7 @@ def create_sft_tab(top_elems: Dict[str, "Component"], runner: "Runner") -> Dict[
|
|||||||
gradient_accumulation_steps,
|
gradient_accumulation_steps,
|
||||||
lr_scheduler_type,
|
lr_scheduler_type,
|
||||||
max_grad_norm,
|
max_grad_norm,
|
||||||
dev_ratio,
|
val_size,
|
||||||
logging_steps,
|
logging_steps,
|
||||||
save_steps,
|
save_steps,
|
||||||
warmup_steps,
|
warmup_steps,
|
||||||
@ -122,7 +122,7 @@ def create_sft_tab(top_elems: Dict[str, "Component"], runner: "Runner") -> Dict[
|
|||||||
gradient_accumulation_steps=gradient_accumulation_steps,
|
gradient_accumulation_steps=gradient_accumulation_steps,
|
||||||
lr_scheduler_type=lr_scheduler_type,
|
lr_scheduler_type=lr_scheduler_type,
|
||||||
max_grad_norm=max_grad_norm,
|
max_grad_norm=max_grad_norm,
|
||||||
dev_ratio=dev_ratio,
|
val_size=val_size,
|
||||||
advanced_tab=advanced_tab,
|
advanced_tab=advanced_tab,
|
||||||
logging_steps=logging_steps,
|
logging_steps=logging_steps,
|
||||||
save_steps=save_steps,
|
save_steps=save_steps,
|
||||||
|
@ -227,9 +227,9 @@ LOCALES = {
|
|||||||
"info": "用于梯度裁剪的范数。"
|
"info": "用于梯度裁剪的范数。"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dev_ratio": {
|
"val_size": {
|
||||||
"en": {
|
"en": {
|
||||||
"label": "Dev ratio",
|
"label": "Val size",
|
||||||
"info": "Proportion of data in the dev set."
|
"info": "Proportion of data in the dev set."
|
||||||
},
|
},
|
||||||
"zh": {
|
"zh": {
|
||||||
|
@ -83,7 +83,7 @@ class Runner:
|
|||||||
gradient_accumulation_steps: int,
|
gradient_accumulation_steps: int,
|
||||||
lr_scheduler_type: str,
|
lr_scheduler_type: str,
|
||||||
max_grad_norm: str,
|
max_grad_norm: str,
|
||||||
dev_ratio: float,
|
val_size: float,
|
||||||
logging_steps: int,
|
logging_steps: int,
|
||||||
save_steps: int,
|
save_steps: int,
|
||||||
warmup_steps: int,
|
warmup_steps: int,
|
||||||
@ -139,8 +139,8 @@ class Runner:
|
|||||||
output_dir=output_dir
|
output_dir=output_dir
|
||||||
)
|
)
|
||||||
|
|
||||||
if dev_ratio > 1e-6:
|
if val_size > 1e-6:
|
||||||
args["dev_ratio"] = dev_ratio
|
args["val_size"] = val_size
|
||||||
args["evaluation_strategy"] = "steps"
|
args["evaluation_strategy"] = "steps"
|
||||||
args["eval_steps"] = save_steps
|
args["eval_steps"] = save_steps
|
||||||
args["load_best_model_at_end"] = True
|
args["load_best_model_at_end"] = True
|
||||||
|
Loading…
x
Reference in New Issue
Block a user