zachzzc commited on
Commit
4eba773
·
verified ·
1 Parent(s): d842d24

Auto update ras

Browse files
Files changed (1) hide show
  1. app.py +5 -0
app.py CHANGED
@@ -546,6 +546,8 @@ def create_ui():
546
  # Enable voice preset and custom reference only for voice-clone template
547
  is_voice_clone = template_name == "voice-clone"
548
  voice_preset_value = "belinda" if is_voice_clone else "EMPTY"
 
 
549
  description_text = f'<p style="font-size: 0.85em; color: var(--body-text-color-subdued); margin: 0; padding: 0;"> {template["description"]}</p>'
550
  return (
551
  template["system_prompt"], # system_prompt
@@ -556,6 +558,7 @@ def create_ui():
556
  ), # voice_preset (value and interactivity)
557
  gr.update(visible=is_voice_clone), # custom reference accordion visibility
558
  gr.update(visible=is_voice_clone), # voice samples section visibility
 
559
  )
560
  else:
561
  return (
@@ -565,6 +568,7 @@ def create_ui():
565
  gr.update(),
566
  gr.update(),
567
  gr.update(),
 
568
  ) # No change if template not found
569
 
570
  # Set up event handlers
@@ -580,6 +584,7 @@ def create_ui():
580
  voice_preset,
581
  custom_reference_accordion,
582
  voice_samples_section,
 
583
  ],
584
  )
585
 
 
546
  # Enable voice preset and custom reference only for voice-clone template
547
  is_voice_clone = template_name == "voice-clone"
548
  voice_preset_value = "belinda" if is_voice_clone else "EMPTY"
549
+ # Set ras_win_len to 0 for single-speaker-bgm, 7 for others
550
+ ras_win_len_value = 0 if template_name == "single-speaker-bgm" else 7
551
  description_text = f'<p style="font-size: 0.85em; color: var(--body-text-color-subdued); margin: 0; padding: 0;"> {template["description"]}</p>'
552
  return (
553
  template["system_prompt"], # system_prompt
 
558
  ), # voice_preset (value and interactivity)
559
  gr.update(visible=is_voice_clone), # custom reference accordion visibility
560
  gr.update(visible=is_voice_clone), # voice samples section visibility
561
+ ras_win_len_value, # ras_win_len
562
  )
563
  else:
564
  return (
 
568
  gr.update(),
569
  gr.update(),
570
  gr.update(),
571
+ gr.update(),
572
  ) # No change if template not found
573
 
574
  # Set up event handlers
 
584
  voice_preset,
585
  custom_reference_accordion,
586
  voice_samples_section,
587
+ ras_win_len,
588
  ],
589
  )
590