mirror of
https://github.com/Nighthawk42/MioTTS.git
synced 2026-08-30 09:42:27 +00:00
35 lines
1.2 KiB
Python
35 lines
1.2 KiB
Python
import os
|
|
import sys
|
|
import importlib.metadata
|
|
|
|
# --- 1. LOCAL FFMPEG INJECTION (Mio Custom) ---
|
|
# This adds your local tools/ffmpeg/bin folder to the path at runtime
|
|
# so you don't need to mess with Windows System Environment Variables.
|
|
project_root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
|
ffmpeg_path = os.path.join(project_root, "tools", "ffmpeg", "bin")
|
|
|
|
if os.path.exists(ffmpeg_path):
|
|
os.environ["PATH"] += os.pathsep + ffmpeg_path
|
|
print(f" > MioTTS: Injected local FFmpeg at {ffmpeg_path}")
|
|
# ---------------------------------------------
|
|
|
|
from transformers.utils.import_utils import (
|
|
is_torch_available,
|
|
is_torchaudio_available,
|
|
)
|
|
|
|
from TTS.utils.import_utils import PYTORCH_IMPORT_ERROR
|
|
|
|
__version__ = importlib.metadata.version("coqui-tts")
|
|
|
|
if "coqpit" in importlib.metadata.packages_distributions().get("coqpit", []):
|
|
msg = (
|
|
"coqui-tts switched to a forked version of Coqpit, but you still have the original "
|
|
"package installed. Run the following to avoid conflicts:\n"
|
|
" pip uninstall coqpit\n"
|
|
" pip install coqpit-config"
|
|
)
|
|
raise ImportError(msg)
|
|
|
|
if not is_torch_available() or not is_torchaudio_available:
|
|
raise ImportError(PYTORCH_IMPORT_ERROR) |