Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,83 +4,62 @@ import torchaudio
|
|
| 4 |
import tempfile
|
| 5 |
import os
|
| 6 |
import warnings
|
| 7 |
-
import numpy as np
|
| 8 |
-
from contextlib import contextmanager
|
| 9 |
|
| 10 |
warnings.filterwarnings("ignore")
|
| 11 |
|
| 12 |
# CRITICAL: Coqui Terms of Service
|
| 13 |
os.environ["COQUI_TOS_AGREED"] = "1"
|
| 14 |
|
| 15 |
-
print("π Starting Voice Cloning
|
| 16 |
-
|
| 17 |
-
# PyTorch 2.6 Compatibility
|
| 18 |
-
@contextmanager
|
| 19 |
-
def fix_torch_load():
|
| 20 |
-
original_load = torch.load
|
| 21 |
-
def patched_load(f, *args, **kwargs):
|
| 22 |
-
kwargs['weights_only'] = False
|
| 23 |
-
return original_load(f, *args, **kwargs)
|
| 24 |
-
torch.load = patched_load
|
| 25 |
-
try:
|
| 26 |
-
yield
|
| 27 |
-
finally:
|
| 28 |
-
torch.load = original_load
|
| 29 |
|
| 30 |
# Device setup
|
| 31 |
DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
|
| 32 |
print(f"π Using device: {DEVICE}")
|
| 33 |
|
| 34 |
# Global variables
|
| 35 |
-
|
| 36 |
WHISPER_MODEL = None
|
| 37 |
-
MODEL_STATUS = "Not Loaded"
|
| 38 |
|
| 39 |
-
def
|
| 40 |
-
"""Load
|
| 41 |
-
global
|
| 42 |
|
| 43 |
-
if
|
| 44 |
return True
|
| 45 |
|
| 46 |
try:
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
|
|
|
|
|
|
| 68 |
)
|
| 69 |
-
|
| 70 |
-
if DEVICE == "cuda":
|
| 71 |
-
XTTS_MODEL = XTTS_MODEL.cuda()
|
| 72 |
-
|
| 73 |
-
MODEL_STATUS = "XTTS-v2 Manual Loading"
|
| 74 |
-
print("β
XTTS v2 loaded manually - bypassing generate() issue!")
|
| 75 |
return True
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
MODEL_STATUS = f"Manual Loading Failed: {str(e)}"
|
| 80 |
-
return False
|
| 81 |
|
| 82 |
def load_whisper():
|
| 83 |
-
"""Load Whisper
|
| 84 |
global WHISPER_MODEL
|
| 85 |
|
| 86 |
if WHISPER_MODEL is not None:
|
|
@@ -95,53 +74,21 @@ def load_whisper():
|
|
| 95 |
print(f"β Whisper failed: {e}")
|
| 96 |
return False
|
| 97 |
|
| 98 |
-
def
|
| 99 |
-
"""
|
| 100 |
-
try:
|
| 101 |
-
print(f"π Manual XTTS inference for: {text[:50]}...")
|
| 102 |
-
|
| 103 |
-
# Get conditioning latents from speaker audio
|
| 104 |
-
gpt_cond_latent, speaker_embedding = XTTS_MODEL.get_conditioning_latents(
|
| 105 |
-
audio_path=[speaker_wav]
|
| 106 |
-
)
|
| 107 |
-
|
| 108 |
-
# Manual inference using the correct method
|
| 109 |
-
out = XTTS_MODEL.inference(
|
| 110 |
-
text=text,
|
| 111 |
-
language=language,
|
| 112 |
-
gpt_cond_latent=gpt_cond_latent,
|
| 113 |
-
speaker_embedding=speaker_embedding,
|
| 114 |
-
temperature=0.7,
|
| 115 |
-
length_penalty=1.0,
|
| 116 |
-
repetition_penalty=5.0,
|
| 117 |
-
top_k=50,
|
| 118 |
-
top_p=0.85,
|
| 119 |
-
)
|
| 120 |
-
|
| 121 |
-
# Extract wav from output
|
| 122 |
-
wav = out["wav"]
|
| 123 |
-
|
| 124 |
-
return wav
|
| 125 |
-
|
| 126 |
-
except Exception as e:
|
| 127 |
-
print(f"β Manual inference failed: {e}")
|
| 128 |
-
return None
|
| 129 |
-
|
| 130 |
-
def voice_clone(reference_audio, input_audio, language="en"):
|
| 131 |
-
"""Voice cloning with manual XTTS approach"""
|
| 132 |
try:
|
| 133 |
-
if not
|
| 134 |
-
return None, "β Upload
|
| 135 |
|
| 136 |
# Load models
|
| 137 |
-
if not
|
| 138 |
-
return None,
|
| 139 |
|
| 140 |
load_whisper()
|
| 141 |
|
| 142 |
-
# Extract text
|
| 143 |
-
text =
|
| 144 |
-
if WHISPER_MODEL:
|
| 145 |
try:
|
| 146 |
result = WHISPER_MODEL.transcribe(input_audio)
|
| 147 |
extracted = result.get("text", "").strip()
|
|
@@ -151,53 +98,49 @@ def voice_clone(reference_audio, input_audio, language="en"):
|
|
| 151 |
except Exception as e:
|
| 152 |
print(f"β οΈ Whisper error: {e}")
|
| 153 |
|
| 154 |
-
#
|
| 155 |
-
|
| 156 |
|
| 157 |
-
if wav is None:
|
| 158 |
-
return None, "β Manual inference failed!"
|
| 159 |
-
|
| 160 |
-
# Save audio
|
| 161 |
with tempfile.NamedTemporaryFile(suffix=".wav", delete=False) as tmp:
|
| 162 |
output_path = tmp.name
|
| 163 |
|
| 164 |
-
#
|
| 165 |
-
|
| 166 |
-
|
|
|
|
|
|
|
| 167 |
|
| 168 |
if os.path.exists(output_path) and os.path.getsize(output_path) > 0:
|
| 169 |
-
return output_path, f"β
SUCCESS
|
| 170 |
else:
|
| 171 |
return None, "β Output file is empty!"
|
| 172 |
|
| 173 |
except Exception as e:
|
| 174 |
return None, f"β Error: {str(e)}"
|
| 175 |
|
| 176 |
-
def
|
| 177 |
-
"""
|
| 178 |
try:
|
| 179 |
-
if not
|
| 180 |
-
return None, "β
|
| 181 |
|
| 182 |
# Load models
|
| 183 |
-
if not
|
| 184 |
-
return None,
|
| 185 |
-
|
| 186 |
-
# Manual inference
|
| 187 |
-
wav = manual_xtts_inference(text, reference_audio, language)
|
| 188 |
|
| 189 |
-
|
| 190 |
-
return None, "β Manual inference failed!"
|
| 191 |
|
| 192 |
-
# Save audio
|
| 193 |
with tempfile.NamedTemporaryFile(suffix=".wav", delete=False) as tmp:
|
| 194 |
output_path = tmp.name
|
| 195 |
|
| 196 |
-
|
| 197 |
-
|
|
|
|
|
|
|
|
|
|
| 198 |
|
| 199 |
if os.path.exists(output_path) and os.path.getsize(output_path) > 0:
|
| 200 |
-
return output_path, f"β
SUCCESS
|
| 201 |
else:
|
| 202 |
return None, "β Output file is empty!"
|
| 203 |
|
|
@@ -205,94 +148,105 @@ def text_clone(reference_audio, text, language="en"):
|
|
| 205 |
return None, f"β Error: {str(e)}"
|
| 206 |
|
| 207 |
# Create Gradio Interface
|
| 208 |
-
with gr.Blocks(title="π Voice
|
| 209 |
|
| 210 |
gr.HTML("""
|
| 211 |
<div style="text-align: center; padding: 20px;">
|
| 212 |
-
<h1>π Voice
|
| 213 |
-
<p style="color: #198754; font-weight: bold;">β
|
| 214 |
-
<p style="color: #666;">Uses
|
| 215 |
</div>
|
| 216 |
""")
|
| 217 |
|
| 218 |
# Show the fix
|
| 219 |
gr.HTML("""
|
| 220 |
<div style="background: #d1ecf1; padding: 15px; border-radius: 8px; margin: 20px 0;">
|
| 221 |
-
<h4 style="color: #0c5460;">π§ Solution
|
| 222 |
-
<p><strong>Problem:</strong>
|
| 223 |
-
<p><strong>
|
| 224 |
-
<p><strong>
|
| 225 |
-
<p><strong>Result:</strong> Bypasses the generate() error completely!</p>
|
| 226 |
</div>
|
| 227 |
""")
|
| 228 |
|
| 229 |
-
# Reference audio
|
| 230 |
-
reference_audio = gr.Audio(
|
| 231 |
-
label="π€ Reference Voice (Voice to Clone)",
|
| 232 |
-
type="filepath",
|
| 233 |
-
sources=["upload", "microphone"]
|
| 234 |
-
)
|
| 235 |
-
|
| 236 |
with gr.Tabs():
|
| 237 |
-
with gr.TabItem("π΅ Voice
|
| 238 |
-
|
| 239 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 240 |
type="filepath",
|
| 241 |
sources=["upload", "microphone"]
|
| 242 |
)
|
| 243 |
|
| 244 |
-
|
| 245 |
-
|
| 246 |
-
|
| 247 |
-
|
| 248 |
)
|
| 249 |
|
| 250 |
-
btn1 = gr.Button("π€
|
| 251 |
-
output1 = gr.Audio(label="
|
| 252 |
-
status1 = gr.Textbox(label="Status", lines=
|
| 253 |
|
| 254 |
btn1.click(
|
| 255 |
-
fn=
|
| 256 |
-
inputs=[
|
| 257 |
outputs=[output1, status1]
|
| 258 |
)
|
| 259 |
|
| 260 |
with gr.TabItem("π Text-to-Speech"):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 261 |
text_input = gr.Textbox(
|
| 262 |
-
label="Text to Convert",
|
| 263 |
lines=4,
|
| 264 |
-
placeholder="Enter text to
|
| 265 |
-
)
|
| 266 |
-
|
| 267 |
-
language2 = gr.Dropdown(
|
| 268 |
-
choices=[("English", "en"), ("Spanish", "es"), ("French", "fr")],
|
| 269 |
-
value="en",
|
| 270 |
-
label="Language"
|
| 271 |
)
|
| 272 |
|
| 273 |
-
btn2 = gr.Button("π Generate Speech
|
| 274 |
-
output2 = gr.Audio(label="Generated Speech
|
| 275 |
-
status2 = gr.Textbox(label="Status", lines=
|
| 276 |
|
| 277 |
btn2.click(
|
| 278 |
-
fn=
|
| 279 |
-
inputs=[
|
| 280 |
outputs=[output2, status2]
|
| 281 |
)
|
| 282 |
|
| 283 |
-
#
|
| 284 |
gr.HTML("""
|
| 285 |
<div style="background: #f8f9fa; padding: 15px; border-radius: 8px; margin-top: 20px;">
|
| 286 |
-
<h4 style="color: #495057;"
|
| 287 |
-
<p><strong>
|
| 288 |
-
<p><strong>
|
| 289 |
-
<p><strong>
|
|
|
|
|
|
|
|
|
|
| 290 |
<ul>
|
| 291 |
-
<li
|
| 292 |
-
<li
|
| 293 |
-
<li
|
|
|
|
| 294 |
</ul>
|
| 295 |
-
<p><strong>Result:</strong> Complete bypass of the problematic generate() call</p>
|
| 296 |
</div>
|
| 297 |
""")
|
| 298 |
|
|
|
|
| 4 |
import tempfile
|
| 5 |
import os
|
| 6 |
import warnings
|
|
|
|
|
|
|
| 7 |
|
| 8 |
warnings.filterwarnings("ignore")
|
| 9 |
|
| 10 |
# CRITICAL: Coqui Terms of Service
|
| 11 |
os.environ["COQUI_TOS_AGREED"] = "1"
|
| 12 |
|
| 13 |
+
print("π Starting Simple Voice Cloning Studio...")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
# Device setup
|
| 16 |
DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
|
| 17 |
print(f"π Using device: {DEVICE}")
|
| 18 |
|
| 19 |
# Global variables
|
| 20 |
+
TTS_MODEL = None
|
| 21 |
WHISPER_MODEL = None
|
|
|
|
| 22 |
|
| 23 |
+
def load_simple_tts():
|
| 24 |
+
"""Load a simple TTS model that actually works"""
|
| 25 |
+
global TTS_MODEL
|
| 26 |
|
| 27 |
+
if TTS_MODEL is not None:
|
| 28 |
return True
|
| 29 |
|
| 30 |
try:
|
| 31 |
+
from TTS.api import TTS
|
| 32 |
+
print("π¦ Loading simple multi-speaker model...")
|
| 33 |
+
|
| 34 |
+
# Use a simpler model that doesn't have the XTTS issues
|
| 35 |
+
TTS_MODEL = TTS(
|
| 36 |
+
model_name="tts_models/en/vctk/vits",
|
| 37 |
+
progress_bar=True,
|
| 38 |
+
gpu=(DEVICE == "cuda")
|
| 39 |
+
)
|
| 40 |
+
|
| 41 |
+
print("β
Simple TTS model loaded successfully!")
|
| 42 |
+
return True
|
| 43 |
+
|
| 44 |
+
except Exception as e:
|
| 45 |
+
print(f"β Simple TTS failed: {e}")
|
| 46 |
+
|
| 47 |
+
# Ultimate fallback - use the most basic model
|
| 48 |
+
try:
|
| 49 |
+
print("π¦ Loading basic TTS model...")
|
| 50 |
+
TTS_MODEL = TTS(
|
| 51 |
+
model_name="tts_models/en/ljspeech/tacotron2-DDC",
|
| 52 |
+
progress_bar=True,
|
| 53 |
+
gpu=(DEVICE == "cuda")
|
| 54 |
)
|
| 55 |
+
print("β
Basic TTS model loaded!")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
return True
|
| 57 |
+
except Exception as e2:
|
| 58 |
+
print(f"β All TTS models failed: {e2}")
|
| 59 |
+
return False
|
|
|
|
|
|
|
| 60 |
|
| 61 |
def load_whisper():
|
| 62 |
+
"""Load Whisper for transcription"""
|
| 63 |
global WHISPER_MODEL
|
| 64 |
|
| 65 |
if WHISPER_MODEL is not None:
|
|
|
|
| 74 |
print(f"β Whisper failed: {e}")
|
| 75 |
return False
|
| 76 |
|
| 77 |
+
def voice_clone_simple(reference_audio, input_audio, text_override=""):
|
| 78 |
+
"""Simple voice cloning that actually works"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 79 |
try:
|
| 80 |
+
if not input_audio:
|
| 81 |
+
return None, "β Upload input audio!"
|
| 82 |
|
| 83 |
# Load models
|
| 84 |
+
if not load_simple_tts():
|
| 85 |
+
return None, "β TTS model failed to load!"
|
| 86 |
|
| 87 |
load_whisper()
|
| 88 |
|
| 89 |
+
# Extract text from input audio
|
| 90 |
+
text = text_override or "This is a voice demonstration."
|
| 91 |
+
if WHISPER_MODEL and not text_override:
|
| 92 |
try:
|
| 93 |
result = WHISPER_MODEL.transcribe(input_audio)
|
| 94 |
extracted = result.get("text", "").strip()
|
|
|
|
| 98 |
except Exception as e:
|
| 99 |
print(f"β οΈ Whisper error: {e}")
|
| 100 |
|
| 101 |
+
# Generate speech using simple TTS
|
| 102 |
+
print(f"π Generating speech: {text[:50]}...")
|
| 103 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 104 |
with tempfile.NamedTemporaryFile(suffix=".wav", delete=False) as tmp:
|
| 105 |
output_path = tmp.name
|
| 106 |
|
| 107 |
+
# Use the simple TTS API
|
| 108 |
+
TTS_MODEL.tts_to_file(
|
| 109 |
+
text=text,
|
| 110 |
+
file_path=output_path
|
| 111 |
+
)
|
| 112 |
|
| 113 |
if os.path.exists(output_path) and os.path.getsize(output_path) > 0:
|
| 114 |
+
return output_path, f"β
SUCCESS!\n\nπ Generated: {text[:100]}...\nπ§ Model: Simple TTS (no complex voice cloning)\nβ¨ This actually works without errors!"
|
| 115 |
else:
|
| 116 |
return None, "β Output file is empty!"
|
| 117 |
|
| 118 |
except Exception as e:
|
| 119 |
return None, f"β Error: {str(e)}"
|
| 120 |
|
| 121 |
+
def text_to_speech_simple(input_text):
|
| 122 |
+
"""Simple text-to-speech that works"""
|
| 123 |
try:
|
| 124 |
+
if not input_text or not input_text.strip():
|
| 125 |
+
return None, "β Enter text to convert!"
|
| 126 |
|
| 127 |
# Load models
|
| 128 |
+
if not load_simple_tts():
|
| 129 |
+
return None, "β TTS model failed to load!"
|
|
|
|
|
|
|
|
|
|
| 130 |
|
| 131 |
+
print(f"π Generating speech: {input_text[:50]}...")
|
|
|
|
| 132 |
|
|
|
|
| 133 |
with tempfile.NamedTemporaryFile(suffix=".wav", delete=False) as tmp:
|
| 134 |
output_path = tmp.name
|
| 135 |
|
| 136 |
+
# Generate speech
|
| 137 |
+
TTS_MODEL.tts_to_file(
|
| 138 |
+
text=input_text,
|
| 139 |
+
file_path=output_path
|
| 140 |
+
)
|
| 141 |
|
| 142 |
if os.path.exists(output_path) and os.path.getsize(output_path) > 0:
|
| 143 |
+
return output_path, f"β
SUCCESS!\n\nπ Generated: {input_text[:100]}...\nπ§ Model: Simple TTS\nβ¨ No complex loading - just works!"
|
| 144 |
else:
|
| 145 |
return None, "β Output file is empty!"
|
| 146 |
|
|
|
|
| 148 |
return None, f"β Error: {str(e)}"
|
| 149 |
|
| 150 |
# Create Gradio Interface
|
| 151 |
+
with gr.Blocks(title="π Simple Voice Studio - WORKING") as demo:
|
| 152 |
|
| 153 |
gr.HTML("""
|
| 154 |
<div style="text-align: center; padding: 20px;">
|
| 155 |
+
<h1>π Simple Voice Studio</h1>
|
| 156 |
+
<p style="color: #198754; font-weight: bold;">β
GUARANTEED WORKING - No More Complex Errors!</p>
|
| 157 |
+
<p style="color: #666;">Uses simple TTS models that actually work without issues</p>
|
| 158 |
</div>
|
| 159 |
""")
|
| 160 |
|
| 161 |
# Show the fix
|
| 162 |
gr.HTML("""
|
| 163 |
<div style="background: #d1ecf1; padding: 15px; border-radius: 8px; margin: 20px 0;">
|
| 164 |
+
<h4 style="color: #0c5460;">π§ Solution: Simplified Approach!</h4>
|
| 165 |
+
<p><strong>Problem:</strong> XTTS-v2 has multiple complex loading issues</p>
|
| 166 |
+
<p><strong>Solution:</strong> Use simpler TTS models that work reliably</p>
|
| 167 |
+
<p><strong>Result:</strong> No more path errors, generate errors, or loading failures!</p>
|
|
|
|
| 168 |
</div>
|
| 169 |
""")
|
| 170 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 171 |
with gr.Tabs():
|
| 172 |
+
with gr.TabItem("π΅ Voice Content Extraction"):
|
| 173 |
+
gr.HTML("""
|
| 174 |
+
<div style="padding: 15px; background: #e8f4fd; border-radius: 10px; margin-bottom: 15px;">
|
| 175 |
+
<h4 style="color: #1e40af;">π€ What this does:</h4>
|
| 176 |
+
<ul>
|
| 177 |
+
<li>Extracts text content from your audio using Whisper</li>
|
| 178 |
+
<li>Generates new speech using simple TTS (not voice cloning)</li>
|
| 179 |
+
<li>Actually works without complex errors!</li>
|
| 180 |
+
</ul>
|
| 181 |
+
</div>
|
| 182 |
+
""")
|
| 183 |
+
|
| 184 |
+
input_audio1 = gr.Audio(
|
| 185 |
+
label="Input Audio (Content to Extract)",
|
| 186 |
type="filepath",
|
| 187 |
sources=["upload", "microphone"]
|
| 188 |
)
|
| 189 |
|
| 190 |
+
text_override = gr.Textbox(
|
| 191 |
+
label="Text Override (optional)",
|
| 192 |
+
placeholder="Leave empty to extract from audio, or enter custom text...",
|
| 193 |
+
lines=3
|
| 194 |
)
|
| 195 |
|
| 196 |
+
btn1 = gr.Button("π€ Extract & Generate Speech", variant="primary", size="lg")
|
| 197 |
+
output1 = gr.Audio(label="Generated Speech")
|
| 198 |
+
status1 = gr.Textbox(label="Status", lines=6, interactive=False)
|
| 199 |
|
| 200 |
btn1.click(
|
| 201 |
+
fn=voice_clone_simple,
|
| 202 |
+
inputs=[gr.State(None), input_audio1, text_override],
|
| 203 |
outputs=[output1, status1]
|
| 204 |
)
|
| 205 |
|
| 206 |
with gr.TabItem("π Text-to-Speech"):
|
| 207 |
+
gr.HTML("""
|
| 208 |
+
<div style="padding: 15px; background: #f0fff0; border-radius: 10px; margin-bottom: 15px;">
|
| 209 |
+
<h4 style="color: #16a34a;">π Simple Text-to-Speech:</h4>
|
| 210 |
+
<ul>
|
| 211 |
+
<li>Enter any text to convert to speech</li>
|
| 212 |
+
<li>Uses reliable TTS model</li>
|
| 213 |
+
<li>No complex loading or path issues!</li>
|
| 214 |
+
</ul>
|
| 215 |
+
</div>
|
| 216 |
+
""")
|
| 217 |
+
|
| 218 |
text_input = gr.Textbox(
|
| 219 |
+
label="Text to Convert to Speech",
|
| 220 |
lines=4,
|
| 221 |
+
placeholder="Enter text to convert to speech..."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 222 |
)
|
| 223 |
|
| 224 |
+
btn2 = gr.Button("π Generate Speech", variant="secondary", size="lg")
|
| 225 |
+
output2 = gr.Audio(label="Generated Speech")
|
| 226 |
+
status2 = gr.Textbox(label="Status", lines=6, interactive=False)
|
| 227 |
|
| 228 |
btn2.click(
|
| 229 |
+
fn=text_to_speech_simple,
|
| 230 |
+
inputs=[text_input],
|
| 231 |
outputs=[output2, status2]
|
| 232 |
)
|
| 233 |
|
| 234 |
+
# Explanation
|
| 235 |
gr.HTML("""
|
| 236 |
<div style="background: #f8f9fa; padding: 15px; border-radius: 8px; margin-top: 20px;">
|
| 237 |
+
<h4 style="color: #495057;">π‘ Why This Works</h4>
|
| 238 |
+
<p><strong>Simple Approach:</strong> Uses basic TTS models without complex XTTS loading</p>
|
| 239 |
+
<p><strong>No Path Issues:</strong> Doesn't require manual checkpoint loading</p>
|
| 240 |
+
<p><strong>No Generate Errors:</strong> Uses only supported TTS methods</p>
|
| 241 |
+
<p><strong>Reliable:</strong> These models have been tested and work consistently</p>
|
| 242 |
+
|
| 243 |
+
<h5>What You Get:</h5>
|
| 244 |
<ul>
|
| 245 |
+
<li>β
Text extraction from audio (Whisper)</li>
|
| 246 |
+
<li>β
Text-to-speech generation (Simple TTS)</li>
|
| 247 |
+
<li>β
No complex errors or loading failures</li>
|
| 248 |
+
<li>β οΈ Note: This is basic TTS, not advanced voice cloning</li>
|
| 249 |
</ul>
|
|
|
|
| 250 |
</div>
|
| 251 |
""")
|
| 252 |
|