Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -4,6 +4,8 @@ import time
|
|
4 |
import sys
|
5 |
import subprocess
|
6 |
import scipy.io.wavfile as wavfile
|
|
|
|
|
7 |
import gradio as gr
|
8 |
from TTS.api import TTS
|
9 |
from TTS.tts.configs.xtts_config import XttsConfig
|
@@ -39,9 +41,11 @@ config = XttsConfig()
|
|
39 |
config.load_json(config_path)
|
40 |
|
41 |
model = Xtts.init_from_config(config)
|
42 |
-
model.load_checkpoint(config, checkpoint_path=checkpoint_path, vocab_path=vocab_path, eval=True, use_deepspeed=
|
43 |
|
44 |
-
|
|
|
|
|
45 |
|
46 |
def predict(prompt, language, reference_audio):
|
47 |
try:
|
@@ -125,11 +129,25 @@ with gr.Blocks(theme=theme) as demo:
|
|
125 |
gr.Markdown(description)
|
126 |
|
127 |
with gr.Row():
|
128 |
-
gr.
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
133 |
|
134 |
with gr.Row():
|
135 |
with gr.Column(scale=2):
|
|
|
4 |
import sys
|
5 |
import subprocess
|
6 |
import scipy.io.wavfile as wavfile
|
7 |
+
import torch
|
8 |
+
import torchaudio
|
9 |
import gradio as gr
|
10 |
from TTS.api import TTS
|
11 |
from TTS.tts.configs.xtts_config import XttsConfig
|
|
|
41 |
config.load_json(config_path)
|
42 |
|
43 |
model = Xtts.init_from_config(config)
|
44 |
+
model.load_checkpoint(config, checkpoint_path=checkpoint_path, vocab_path=vocab_path, eval=True, use_deepspeed=True)
|
45 |
|
46 |
+
model.cuda()
|
47 |
+
|
48 |
+
print("Modelo cargado en GPU")
|
49 |
|
50 |
def predict(prompt, language, reference_audio):
|
51 |
try:
|
|
|
129 |
gr.Markdown(description)
|
130 |
|
131 |
with gr.Row():
|
132 |
+
with gr.Column(equal_height=True): # Esto centra la imagen en la fila
|
133 |
+
gr.Image(
|
134 |
+
"https://www.labattaglia.com.ar/images/about_me_pic2.jpg",
|
135 |
+
label="",
|
136 |
+
show_label=False,
|
137 |
+
container=False, # Esto permite que la imagen se ajuste al contenedor
|
138 |
+
elem_id="image-container" # Asigna un ID CSS para agregar estilos personalizados
|
139 |
+
)
|
140 |
+
|
141 |
+
# Agregamos estilos CSS personalizados
|
142 |
+
demo.css = """
|
143 |
+
#image-container img {
|
144 |
+
display: block;
|
145 |
+
margin-left: auto;
|
146 |
+
margin-right: auto;
|
147 |
+
max-width: 256px; /* Ancho máximo de 256px */
|
148 |
+
height: auto; /* Mantener la relación de aspecto */
|
149 |
+
}
|
150 |
+
"""
|
151 |
|
152 |
with gr.Row():
|
153 |
with gr.Column(scale=2):
|