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