github-actions[bot] commited on
Commit
d2e668f
·
1 Parent(s): 2a0edfe

Auto-sync from demo at Thu Oct 16 11:44:02 UTC 2025

Browse files
Files changed (2) hide show
  1. app.py +14 -1
  2. webui/app.py +14 -1
app.py CHANGED
@@ -477,7 +477,7 @@ with gr.Blocks(title="GraphGen Demo", theme=gr.themes.Glass(), css=css) as demo:
477
  )
478
  ece_unit_sampling = gr.Radio(
479
  label=_("Unit Sampling Strategy"),
480
- choices=["random", "max_loss", "min_loss"],
481
  value="random",
482
  interactive=True,
483
  info=_("Unit Sampling Strategy Info"),
@@ -590,6 +590,19 @@ with gr.Blocks(title="GraphGen Demo", theme=gr.themes.Glass(), css=css) as demo:
590
  ],
591
  )
592
 
 
 
 
 
 
 
 
 
 
 
 
 
 
593
  upload_file.change(
594
  preview_file, inputs=upload_file, outputs=[preview_code, preview_df]
595
  ).then(
 
477
  )
478
  ece_unit_sampling = gr.Radio(
479
  label=_("Unit Sampling Strategy"),
480
+ choices=["random"],
481
  value="random",
482
  interactive=True,
483
  info=_("Unit Sampling Strategy Info"),
 
590
  ],
591
  )
592
 
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
+
606
  upload_file.change(
607
  preview_file, inputs=upload_file, outputs=[preview_code, preview_df]
608
  ).then(
webui/app.py CHANGED
@@ -477,7 +477,7 @@ with gr.Blocks(title="GraphGen Demo", theme=gr.themes.Glass(), css=css) as demo:
477
  )
478
  ece_unit_sampling = gr.Radio(
479
  label=_("Unit Sampling Strategy"),
480
- choices=["random", "max_loss", "min_loss"],
481
  value="random",
482
  interactive=True,
483
  info=_("Unit Sampling Strategy Info"),
@@ -590,6 +590,19 @@ with gr.Blocks(title="GraphGen Demo", theme=gr.themes.Glass(), css=css) as demo:
590
  ],
591
  )
592
 
 
 
 
 
 
 
 
 
 
 
 
 
 
593
  upload_file.change(
594
  preview_file, inputs=upload_file, outputs=[preview_code, preview_df]
595
  ).then(
 
477
  )
478
  ece_unit_sampling = gr.Radio(
479
  label=_("Unit Sampling Strategy"),
480
+ choices=["random"],
481
  value="random",
482
  interactive=True,
483
  info=_("Unit Sampling Strategy Info"),
 
590
  ],
591
  )
592
 
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
+
606
  upload_file.change(
607
  preview_file, inputs=upload_file, outputs=[preview_code, preview_df]
608
  ).then(