Spaces:
Sleeping
Sleeping
Update app.py
Browse files1223449 unmodified lines54555657585960126 unmodified lines18718818919019019119219322 unmodified lines216217218219219220221222import gradio as grimport torchimport numpy as npimport reimport soundfile as sf49 unmodified lines text = re.sub(r'\b(\d{1,4})\b', lambda m: self.number_to_words(int(m.group())), text) text = re.sub(r'\b(1[0-9]{3}|20[0-9]{2}|2100)\b', lambda m: m.group(), text) text = re.sub(r'[^\w\s\.,!?;:\-\(\)\'"]', ' ', text) text = re.sub(r'\s+', ' ', text) return text.strip()
def number_to_words(self, num):126 unmodified lines gr.HTML(""" <div class="main-header"> <h1>🎤 Long-Form Text-to-Speech Generator</h1> <p style="color: #666; font-size: 1.1em;">Choose a voice and transform any text into expressive human-like speech</p> <p style="color: #666; font-size: 1.1em;">Choose a voice and transform any written text into expressive human-like speech</p> </div> """) if tts_system:22 unmodified lines char_count = gr.HTML("<span style='color: #666;'>Character count: 0 / 50,000</span>") speaker_dropdown = gr.Dropdown( choices=tts_system.speakers if tts_system else [], value="p225" if tts_system else None, value=tts_system.speakers[0] if tts_system else None, label="🗣️ Choose Voice" ) generate_btn = gr.Button("🎯 Generate Speech", variant="primary", size="lg", scale=1)app.py+3-3