Skip to content

Commit

Permalink
lazy loading of transcribe anything
Browse files Browse the repository at this point in the history
  • Loading branch information
zackees committed May 10, 2023
1 parent 1298c9b commit 1777c8e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/video_subtitles/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
import os
import shutil

from transcribe_anything.api import transcribe

from video_subtitles.translate import srt_wrap, translate

IS_GITHUB = os.environ.get("GITHUB_ACTIONS", False)
Expand All @@ -29,6 +27,10 @@ def run( # pylint: disable=too-many-locals,too-many-branches,too-many-statement
model: str,
) -> str:
"""Run the program."""
from transcribe_anything.api import ( # pylint: disable=import-outside-toplevel
transcribe,
)

print("Running transcription")
out_languages = out_languages.copy()
print(f"Output languages: {out_languages}")
Expand Down

0 comments on commit 1777c8e

Please sign in to comment.