Skip to content

Commit

Permalink
Late-import main TTS libraries in tts CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
akx committed Sep 26, 2023
1 parent 5c047cf commit 0a82f06
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions TTS/bin/synthesize.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@
# 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.
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 0a82f06

Please sign in to comment.