Skip to content

Commit

Permalink
Lazy load class for faster help output from CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
beveradb committed Jan 30, 2024
1 parent 4cfd19d commit ee1c980
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -162,4 +162,6 @@ cython_debug/
# Project specific
/output/
/input/
*.wav
*.flac

4 changes: 3 additions & 1 deletion lyrics_transcriber/utils/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import argparse
import logging
import pkg_resources
from lyrics_transcriber import LyricsTranscriber


def main():
Expand Down Expand Up @@ -110,6 +109,9 @@ def main():

logger.debug("Loading LyricsTranscriber class")

# Lazy load this class so help output is printed quickly rather than waiting for heavy libraries to load
from lyrics_transcriber import LyricsTranscriber

transcriber = LyricsTranscriber(
args.audio_filepath,
genius_api_token=args.genius_api_token,
Expand Down

0 comments on commit ee1c980

Please sign in to comment.