Skip to content

Commit 5c20efe

Browse files
fix: force ece_unit_sampling to random when trainee model is disabled
1 parent a2f2b80 commit 5c20efe

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

webui/app.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ def sum_tokens(client):
477477
)
478478
ece_unit_sampling = gr.Radio(
479479
label=_("Unit Sampling Strategy"),
480-
choices=["random", "max_loss", "min_loss"],
480+
choices=["random"],
481481
value="random",
482482
interactive=True,
483483
info=_("Unit Sampling Strategy Info"),
@@ -590,6 +590,19 @@ def toggle_partition_params(method):
590590
],
591591
)
592592

593+
if_trainee_model.change(
594+
lambda on: (
595+
gr.update(
596+
choices=["random"]
597+
if not on
598+
else ["random", "max_loss", "min_loss"],
599+
value="random",
600+
)
601+
),
602+
inputs=if_trainee_model,
603+
outputs=ece_unit_sampling,
604+
)
605+
593606
upload_file.change(
594607
preview_file, inputs=upload_file, outputs=[preview_code, preview_df]
595608
).then(

0 commit comments

Comments
 (0)