JS6969 commited on
Commit
2f81a3f
·
verified ·
1 Parent(s): 305f630

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +29 -9
app.py CHANGED
@@ -646,6 +646,19 @@ setTimeout(() => {{
646
  settings.get("name", ""),
647
  ),
648
  )
 
 
 
 
 
 
 
 
 
 
 
 
 
649
  chunk_size = gr.Slider(1, 50, value=10, step=1, label="Chunk size")
650
  gpu_budget = gr.Slider(20, 110, value=55, step=5, label="Max seconds per GPU call")
651
 
@@ -660,18 +673,25 @@ setTimeout(() => {{
660
  "trigger": trigv, "begin": begv, "end": endv,
661
  "excel_thumb_px": int(excel_px),
662
  "max_side": int(ms),
663
- "dataset_name": ds_name or "forgecaptions",
664
  })
665
  save_settings(cfg)
666
  return instr
667
-
668
- for comp in [style_checks, extra_opts, name_input, trig, add_start, add_end, excel_thumb_px, max_side, dataset_name]:
669
- comp.change(_refresh_instruction,
670
- inputs=[style_checks, extra_opts, name_input, trig, add_start, add_end, excel_thumb_px, max_side, dataset_name],
671
- outputs=[instruction_preview])
672
-
673
- demo.load(lambda s,e,n: final_instruction(s or ["Character training (long)"], e or [], n),
674
- inputs=[style_checks, extra_opts, name_input], outputs=[instruction_preview])
 
 
 
 
 
 
 
 
675
 
676
  # ---- Shape Aliases accordion (with examples & buttons)
677
  with gr.Accordion("Shape Aliases", open=False):
 
646
  settings.get("name", ""),
647
  ),
648
  )
649
+ dataset_name = gr.Textbox(
650
+ label="Dataset name (export title prefix)",
651
+ value=settings.get("dataset_name", "forgecaptions"),
652
+ )
653
+ max_side = gr.Slider(256, 1024, settings.get("max_side", 896), step=32, label="Max side (resize)")
654
+ excel_thumb_px = gr.Slider(64, 256, value=settings.get("excel_thumb_px", 128), step=8, label="Excel thumbnail size (px)")
655
+
656
+ # Chunking controls (restored)
657
+ chunk_mode = gr.Radio(
658
+ choices=["Auto", "Manual (all at once)", "Manual (step)"],
659
+ value="Manual (step)",
660
+ label="Batch mode",
661
+ )
662
  chunk_size = gr.Slider(1, 50, value=10, step=1, label="Chunk size")
663
  gpu_budget = gr.Slider(20, 110, value=55, step=5, label="Max seconds per GPU call")
664
 
 
673
  "trigger": trigv, "begin": begv, "end": endv,
674
  "excel_thumb_px": int(excel_px),
675
  "max_side": int(ms),
 
676
  })
677
  save_settings(cfg)
678
  return instr
679
+
680
+ for comp in (
681
+ style_checks, extra_opts, name_input, trig, add_start, add_end, excel_thumb_px, max_side
682
+ ):
683
+ comp.change(
684
+ _refresh_instruction,
685
+ inputs=[style_checks, extra_opts, name_input, trig, add_start, add_end, excel_thumb_px, max_side],
686
+ outputs=[instruction_preview],
687
+ )
688
+
689
+ # Also set the initial instruction on load (optional but nice)
690
+ demo.load(
691
+ lambda s, e, n: final_instruction(s or ["Character training (long)"], e or [], n),
692
+ inputs=[style_checks, extra_opts, name_input],
693
+ outputs=[instruction_preview],
694
+ )
695
 
696
  # ---- Shape Aliases accordion (with examples & buttons)
697
  with gr.Accordion("Shape Aliases", open=False):