Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -10,7 +10,6 @@ from TTS.tts.configs.xtts_config import XttsConfig
|
|
10 |
from TTS.tts.models.xtts import Xtts
|
11 |
from TTS.utils.generic_utils import get_user_data_dir
|
12 |
from huggingface_hub import hf_hub_download
|
13 |
-
import MeCab
|
14 |
|
15 |
# Configuración inicial
|
16 |
os.environ["COQUI_TOS_AGREED"] = "1"
|
@@ -22,18 +21,6 @@ def check_and_install(package):
|
|
22 |
print(f"{package} no está instalado. Instalando...")
|
23 |
subprocess.check_call([sys.executable, "-m", "pip", "install", package])
|
24 |
|
25 |
-
# Asegurar que MeCab y UniDic estén instalados
|
26 |
-
check_and_install("MeCab")
|
27 |
-
check_and_install("unidic-lite")
|
28 |
-
|
29 |
-
# Descargar UniDic
|
30 |
-
os.system('python -m unidic download')
|
31 |
-
|
32 |
-
# Configurar MeCab con la ruta explícita al archivo mecabrc
|
33 |
-
unidic_dir = os.path.dirname(os.path.abspath(MeCab.__file__))
|
34 |
-
mecabrc_path = os.path.join(unidic_dir, 'dicdir', 'mecabrc')
|
35 |
-
os.environ["MECABRC"] = mecabrc_path
|
36 |
-
|
37 |
print("Descargando y configurando el modelo...")
|
38 |
repo_id = "Blakus/Pedro_Lab_XTTS"
|
39 |
local_dir = os.path.join(get_user_data_dir("tts"), "tts_models--multilingual--multi-dataset--xtts_v2")
|
|
|
10 |
from TTS.tts.models.xtts import Xtts
|
11 |
from TTS.utils.generic_utils import get_user_data_dir
|
12 |
from huggingface_hub import hf_hub_download
|
|
|
13 |
|
14 |
# Configuración inicial
|
15 |
os.environ["COQUI_TOS_AGREED"] = "1"
|
|
|
21 |
print(f"{package} no está instalado. Instalando...")
|
22 |
subprocess.check_call([sys.executable, "-m", "pip", "install", package])
|
23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
print("Descargando y configurando el modelo...")
|
25 |
repo_id = "Blakus/Pedro_Lab_XTTS"
|
26 |
local_dir = os.path.join(get_user_data_dir("tts"), "tts_models--multilingual--multi-dataset--xtts_v2")
|