1010from arvc .engine .models .optimizers import get_optimizer_choices , get_optimizer_info
1111from arvc .engine .models .generators import get_vocoder_choices
1212
13+ # ── Styled section label (replaces ugly ### headers) ──────────────────────
14+ def _section (title ):
15+ """Render a clean section label with a subtle left accent bar."""
16+ return gr .HTML (
17+ f'<div style="display:flex;align-items:center;gap:8px;margin:4px 0 2px 0;">'
18+ f'<span style="width:3px;height:18px;border-radius:2px;background:linear-gradient(180deg,#6366f1,#8b5cf6);display:inline-block;"></span>'
19+ f'<span style="font-size:13px;font-weight:600;color:#c4b5fd;letter-spacing:0.3px;">{ title } </span>'
20+ f'</div>'
21+ )
22+
23+
1324def training_model_tab ():
1425 with gr .Column ():
1526 gr .Markdown (translations ["training_markdown" ])
@@ -101,7 +112,7 @@ def training_model_tab():
101112 with gr .Accordion ("2. Feature Extraction" , open = False ):
102113 with gr .Row (equal_height = False ):
103114 with gr .Column (scale = 1 ):
104- gr . Markdown ( f"** { translations ['f0_method' ]} **" )
115+ _section ( translations ['f0_method' ])
105116 onnx_f0_mode2 = gr .Checkbox (label = translations ["f0_onnx_mode" ], value = False , interactive = True )
106117 unlock_full_method4 = gr .Checkbox (label = translations ["f0_unlock" ], value = False , interactive = True )
107118 autotune = gr .Checkbox (label = translations ["autotune" ], value = False , interactive = True )
@@ -131,7 +142,7 @@ def training_model_tab():
131142 )
132143
133144 with gr .Column (scale = 1 ):
134- gr . Markdown ( f"** { translations ['hubert_model' ]} **" )
145+ _section ( translations ['hubert_model' ])
135146 embed_mode2 = gr .Radio (
136147 label = translations ["embed_mode" ], info = translations ["embed_mode_info" ],
137148 value = "fairseq" , choices = embedders_mode , interactive = True ,
@@ -162,7 +173,7 @@ def training_model_tab():
162173 with gr .Accordion ("4. Model Training" , open = False ):
163174 # ── Training Parameters ──
164175 with gr .Group ():
165- gr . Markdown ( "### Training Parameters" )
176+ _section ( " Training Parameters" )
166177 with gr .Row (equal_height = False ):
167178 with gr .Column (scale = 1 ):
168179 total_epochs = gr .Slider (
@@ -197,16 +208,16 @@ def training_model_tab():
197208
198209 # ── PyTorch Weight Format ──
199210 with gr .Group ():
200- gr . Markdown ( "### PyTorch Weight Format" )
211+ _section ( " PyTorch Weight Format" )
201212 newpytorch = gr .Checkbox (
202213 label = "New PyTorch 2.0+ Format" ,
203- info = "Enable PyTorch 2.0+ parametrization format. Default: OFF = Old format (.weight_g/.weight_v) for broad RVC fork compatibility." ,
214+ info = "Default: OFF = Old format (.weight_g/.weight_v) for broad RVC fork compatibility. Turn ON for PyTorch 2.0+ parametrization format ." ,
204215 value = False , interactive = True ,
205216 )
206217
207218 # ── Training Options ──
208219 with gr .Group ():
209- gr . Markdown ( "### Training Options" )
220+ _section ( " Training Options" )
210221 with gr .Row ():
211222 cache_in_gpu = gr .Checkbox (label = translations ["cache_in_gpu" ], info = translations ["cache_in_gpu_info" ], value = True , interactive = True )
212223 overtraining_detector = gr .Checkbox (label = translations ["overtraining_detector" ], info = translations ["overtraining_detector_info" ], value = False , interactive = True )
@@ -218,15 +229,15 @@ def training_model_tab():
218229
219230 # ── Pretrain & Dataset ──
220231 with gr .Group ():
221- gr . Markdown ( "### Pretrain & Dataset" )
232+ _section ( " Pretrain & Dataset" )
222233 with gr .Row ():
223234 not_use_pretrain = gr .Checkbox (label = translations ["not_use_pretrain_2" ], info = translations ["not_use_pretrain_info" ], value = False , interactive = True )
224235 custom_pretrain = gr .Checkbox (label = translations ["custom_pretrain" ], info = translations ["custom_pretrain_info" ], value = False , interactive = True )
225236 custom_dataset = gr .Checkbox (label = translations ["custom_dataset" ], info = translations ["custom_dataset_info" ], value = False , interactive = True )
226237
227238 # ── Advanced Settings ──
228239 with gr .Group ():
229- gr . Markdown ( "### Advanced Settings" )
240+ _section ( " Advanced Settings" )
230241 with gr .Row ():
231242 multiscale_mel_loss = gr .Checkbox (label = translations ["multiscale_mel_loss" ], info = translations ["multiscale_mel_loss_info" ], value = False , interactive = True )
232243 cosine_lr = gr .Checkbox (label = "Cosine Annealing LR" , info = "Use CosineAnnealingLR scheduler for better training quality (recommended)" , value = True , interactive = True )
@@ -239,7 +250,7 @@ def training_model_tab():
239250 pretrain_setting = gr .Group (visible = False )
240251 with pretrain_setting :
241252 with gr .Accordion (translations ["custom_pretrain_info" ], open = True ):
242- gr . Markdown ( f"** { translations .get ('select_pretrain' , 'Select from pretrained list' )} **" )
253+ _section ( translations .get ('select_pretrain' , 'Select from pretrained list' ))
243254 pretrained_data = fetch_pretrained_data ()
244255 _pretrained_names = list (pretrained_data .keys ()) if pretrained_data else []
245256 _first_model = _pretrained_names [0 ] if _pretrained_names else ''
@@ -256,7 +267,7 @@ def training_model_tab():
256267 value = _first_sr_choices [0 ] if _first_sr_choices else '' ,
257268 interactive = True ,
258269 )
259- gr . Markdown ( f"** { translations .get ('custom_pretrain_info' , 'Or select files manually' )} **" )
270+ _section ( translations .get ('custom_pretrain_info' , 'Or select files manually' ))
260271 with gr .Row ():
261272 pretrained_D = gr .Dropdown (
262273 label = translations ["pretrain_file" ].format (dg = "D" ),
0 commit comments