Spaces:
Sleeping
Sleeping
Initial commit
Browse filesThis view is limited to 50 files because it contains too many changes. Β
See raw diff
- app.py +5 -5
- {chatterbox/src/chatterbox β echobox/src/echobox}/__init__.py +0 -0
- {chatterbox/src/chatterbox β echobox/src/echobox}/__pycache__/__init__.cpython-311.pyc +0 -0
- {chatterbox/src/chatterbox β echobox/src/echobox}/__pycache__/tts.cpython-311.pyc +0 -0
- {chatterbox/src/chatterbox β echobox/src/echobox}/__pycache__/utils.cpython-311.pyc +0 -0
- {chatterbox/src/chatterbox β echobox/src/echobox}/__pycache__/vc.cpython-311.pyc +0 -0
- {chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/__init__.py +0 -0
- {chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/__pycache__/__init__.cpython-311.pyc +0 -0
- {chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/__pycache__/const.cpython-311.pyc +0 -0
- {chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/__pycache__/decoder.cpython-311.pyc +0 -0
- {chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/__pycache__/f0_predictor.cpython-311.pyc +0 -0
- {chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/__pycache__/flow.cpython-311.pyc +0 -0
- {chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/__pycache__/flow_matching.cpython-311.pyc +0 -0
- {chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/__pycache__/hifigan.cpython-311.pyc +0 -0
- {chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/__pycache__/s3gen.cpython-311.pyc +0 -0
- {chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/__pycache__/xvector.cpython-311.pyc +0 -0
- {chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/const.py +0 -0
- {chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/decoder.py +0 -0
- {chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/f0_predictor.py +0 -0
- {chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/flow.py +0 -0
- {chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/flow_matching.py +0 -0
- {chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/hifigan.py +0 -0
- {chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/matcha/__pycache__/decoder.cpython-311.pyc +0 -0
- {chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/matcha/__pycache__/flow_matching.cpython-311.pyc +0 -0
- {chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/matcha/__pycache__/transformer.cpython-311.pyc +0 -0
- {chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/matcha/decoder.py +0 -0
- {chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/matcha/flow_matching.py +0 -0
- {chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/matcha/text_encoder.py +0 -0
- {chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/matcha/transformer.py +0 -0
- {chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/s3gen.py +0 -0
- {chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/transformer/__init__.py +0 -0
- {chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/transformer/__pycache__/__init__.cpython-311.pyc +0 -0
- {chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/transformer/__pycache__/activation.cpython-311.pyc +0 -0
- {chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/transformer/__pycache__/attention.cpython-311.pyc +0 -0
- {chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/transformer/__pycache__/convolution.cpython-311.pyc +0 -0
- {chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/transformer/__pycache__/embedding.cpython-311.pyc +0 -0
- {chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/transformer/__pycache__/encoder_layer.cpython-311.pyc +0 -0
- {chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/transformer/__pycache__/positionwise_feed_forward.cpython-311.pyc +0 -0
- {chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/transformer/__pycache__/subsampling.cpython-311.pyc +0 -0
- {chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/transformer/__pycache__/upsample_encoder.cpython-311.pyc +0 -0
- {chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/transformer/activation.py +0 -0
- {chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/transformer/attention.py +0 -0
- {chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/transformer/convolution.py +0 -0
- {chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/transformer/embedding.py +0 -0
- {chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/transformer/encoder_layer.py +0 -0
- {chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/transformer/positionwise_feed_forward.py +0 -0
- {chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/transformer/subsampling.py +0 -0
- {chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/transformer/upsample_encoder.py +0 -0
- {chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/utils/__pycache__/class_utils.cpython-311.pyc +0 -0
- {chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/utils/__pycache__/mask.cpython-311.pyc +0 -0
app.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
import random
|
2 |
import numpy as np
|
3 |
import torch
|
4 |
-
from
|
5 |
import gradio as gr
|
6 |
import spaces
|
7 |
|
@@ -12,13 +12,13 @@ print(f"π Running on device: {DEVICE}")
|
|
12 |
MODEL = None
|
13 |
|
14 |
def get_or_load_model():
|
15 |
-
"""Loads the
|
16 |
and ensures it's on the correct device."""
|
17 |
global MODEL
|
18 |
if MODEL is None:
|
19 |
print("Model not loaded, initializing...")
|
20 |
try:
|
21 |
-
MODEL =
|
22 |
if hasattr(MODEL, 'to') and str(MODEL.device) != DEVICE:
|
23 |
MODEL.to(DEVICE)
|
24 |
print(f"Model loaded successfully. Internal device: {getattr(MODEL, 'device', 'N/A')}")
|
@@ -52,7 +52,7 @@ def generate_tts_audio(
|
|
52 |
cfgw_input: float
|
53 |
) -> tuple[int, np.ndarray]:
|
54 |
"""
|
55 |
-
Generates TTS audio using the
|
56 |
|
57 |
Args:
|
58 |
text_input: The text to synthesize (max 300 characters).
|
@@ -87,7 +87,7 @@ def generate_tts_audio(
|
|
87 |
with gr.Blocks() as demo:
|
88 |
gr.Markdown(
|
89 |
"""
|
90 |
-
#
|
91 |
Generate high-quality speech from text with reference audio styling.
|
92 |
"""
|
93 |
)
|
|
|
1 |
import random
|
2 |
import numpy as np
|
3 |
import torch
|
4 |
+
from echobox.src.echobox.tts import EchoBoxTTS
|
5 |
import gradio as gr
|
6 |
import spaces
|
7 |
|
|
|
12 |
MODEL = None
|
13 |
|
14 |
def get_or_load_model():
|
15 |
+
"""Loads the EchoBoxTTS model if it hasn't been loaded already,
|
16 |
and ensures it's on the correct device."""
|
17 |
global MODEL
|
18 |
if MODEL is None:
|
19 |
print("Model not loaded, initializing...")
|
20 |
try:
|
21 |
+
MODEL = EchoBoxTTS.from_pretrained(DEVICE)
|
22 |
if hasattr(MODEL, 'to') and str(MODEL.device) != DEVICE:
|
23 |
MODEL.to(DEVICE)
|
24 |
print(f"Model loaded successfully. Internal device: {getattr(MODEL, 'device', 'N/A')}")
|
|
|
52 |
cfgw_input: float
|
53 |
) -> tuple[int, np.ndarray]:
|
54 |
"""
|
55 |
+
Generates TTS audio using the EchoboxTTS model.
|
56 |
|
57 |
Args:
|
58 |
text_input: The text to synthesize (max 300 characters).
|
|
|
87 |
with gr.Blocks() as demo:
|
88 |
gr.Markdown(
|
89 |
"""
|
90 |
+
# EchoBox TTS Demo
|
91 |
Generate high-quality speech from text with reference audio styling.
|
92 |
"""
|
93 |
)
|
{chatterbox/src/chatterbox β echobox/src/echobox}/__init__.py
RENAMED
File without changes
|
{chatterbox/src/chatterbox β echobox/src/echobox}/__pycache__/__init__.cpython-311.pyc
RENAMED
File without changes
|
{chatterbox/src/chatterbox β echobox/src/echobox}/__pycache__/tts.cpython-311.pyc
RENAMED
File without changes
|
{chatterbox/src/chatterbox β echobox/src/echobox}/__pycache__/utils.cpython-311.pyc
RENAMED
File without changes
|
{chatterbox/src/chatterbox β echobox/src/echobox}/__pycache__/vc.cpython-311.pyc
RENAMED
File without changes
|
{chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/__init__.py
RENAMED
File without changes
|
{chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/__pycache__/__init__.cpython-311.pyc
RENAMED
File without changes
|
{chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/__pycache__/const.cpython-311.pyc
RENAMED
File without changes
|
{chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/__pycache__/decoder.cpython-311.pyc
RENAMED
File without changes
|
{chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/__pycache__/f0_predictor.cpython-311.pyc
RENAMED
File without changes
|
{chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/__pycache__/flow.cpython-311.pyc
RENAMED
File without changes
|
{chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/__pycache__/flow_matching.cpython-311.pyc
RENAMED
File without changes
|
{chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/__pycache__/hifigan.cpython-311.pyc
RENAMED
File without changes
|
{chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/__pycache__/s3gen.cpython-311.pyc
RENAMED
File without changes
|
{chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/__pycache__/xvector.cpython-311.pyc
RENAMED
File without changes
|
{chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/const.py
RENAMED
File without changes
|
{chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/decoder.py
RENAMED
File without changes
|
{chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/f0_predictor.py
RENAMED
File without changes
|
{chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/flow.py
RENAMED
File without changes
|
{chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/flow_matching.py
RENAMED
File without changes
|
{chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/hifigan.py
RENAMED
File without changes
|
{chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/matcha/__pycache__/decoder.cpython-311.pyc
RENAMED
File without changes
|
{chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/matcha/__pycache__/flow_matching.cpython-311.pyc
RENAMED
File without changes
|
{chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/matcha/__pycache__/transformer.cpython-311.pyc
RENAMED
File without changes
|
{chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/matcha/decoder.py
RENAMED
File without changes
|
{chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/matcha/flow_matching.py
RENAMED
File without changes
|
{chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/matcha/text_encoder.py
RENAMED
File without changes
|
{chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/matcha/transformer.py
RENAMED
File without changes
|
{chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/s3gen.py
RENAMED
File without changes
|
{chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/transformer/__init__.py
RENAMED
File without changes
|
{chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/transformer/__pycache__/__init__.cpython-311.pyc
RENAMED
File without changes
|
{chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/transformer/__pycache__/activation.cpython-311.pyc
RENAMED
File without changes
|
{chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/transformer/__pycache__/attention.cpython-311.pyc
RENAMED
File without changes
|
{chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/transformer/__pycache__/convolution.cpython-311.pyc
RENAMED
File without changes
|
{chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/transformer/__pycache__/embedding.cpython-311.pyc
RENAMED
File without changes
|
{chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/transformer/__pycache__/encoder_layer.cpython-311.pyc
RENAMED
File without changes
|
{chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/transformer/__pycache__/positionwise_feed_forward.cpython-311.pyc
RENAMED
File without changes
|
{chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/transformer/__pycache__/subsampling.cpython-311.pyc
RENAMED
File without changes
|
{chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/transformer/__pycache__/upsample_encoder.cpython-311.pyc
RENAMED
File without changes
|
{chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/transformer/activation.py
RENAMED
File without changes
|
{chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/transformer/attention.py
RENAMED
File without changes
|
{chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/transformer/convolution.py
RENAMED
File without changes
|
{chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/transformer/embedding.py
RENAMED
File without changes
|
{chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/transformer/encoder_layer.py
RENAMED
File without changes
|
{chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/transformer/positionwise_feed_forward.py
RENAMED
File without changes
|
{chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/transformer/subsampling.py
RENAMED
File without changes
|
{chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/transformer/upsample_encoder.py
RENAMED
File without changes
|
{chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/utils/__pycache__/class_utils.cpython-311.pyc
RENAMED
File without changes
|
{chatterbox/src/chatterbox β echobox/src/echobox}/models/s3gen/utils/__pycache__/mask.cpython-311.pyc
RENAMED
File without changes
|