mirror of https://github.com/coqui-ai/TTS.git
Late-import main TTS libraries in `tts` CLI
This commit is contained in:
parent
5c047cf304
commit
0a82f063cc
|
@ -8,10 +8,6 @@ from argparse import RawTextHelpFormatter
|
||||||
# pylint: disable=redefined-outer-name, unused-argument
|
# pylint: disable=redefined-outer-name, unused-argument
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from TTS.api import TTS
|
|
||||||
from TTS.utils.manage import ModelManager
|
|
||||||
from TTS.utils.synthesizer import Synthesizer
|
|
||||||
|
|
||||||
description = """
|
description = """
|
||||||
Synthesize speech on command line.
|
Synthesize speech on command line.
|
||||||
|
|
||||||
|
@ -339,6 +335,11 @@ def main():
|
||||||
if not any(check_args):
|
if not any(check_args):
|
||||||
parser.parse_args(["-h"])
|
parser.parse_args(["-h"])
|
||||||
|
|
||||||
|
# Late-import to make things load faster
|
||||||
|
from TTS.api import TTS
|
||||||
|
from TTS.utils.manage import ModelManager
|
||||||
|
from TTS.utils.synthesizer import Synthesizer
|
||||||
|
|
||||||
# load model manager
|
# load model manager
|
||||||
path = Path(__file__).parent / "../.models.json"
|
path = Path(__file__).parent / "../.models.json"
|
||||||
manager = ModelManager(path, progress_bar=args.progress_bar)
|
manager = ModelManager(path, progress_bar=args.progress_bar)
|
||||||
|
|
Loading…
Reference in New Issue