diff --git a/LICENSE b/LICENSE index 153d416..0a04128 100644 --- a/LICENSE +++ b/LICENSE @@ -162,4 +162,4 @@ General Public License ever published by the Free Software Foundation. whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the -Library. \ No newline at end of file +Library. diff --git a/requirements-dev.txt b/requirements-dev.txt index 0b8bc5c..4329e7a 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,2 +1,2 @@ -pre-commit hatch +pre-commit diff --git a/requirements.txt b/requirements.txt index b20a991..8e737ae 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ -pyav -faster-whisper -srt -numpy blessed enlighten +faster-whisper +numpy +pyav +srt diff --git a/whispersubs/__main__.py b/whispersubs/__main__.py index fc720f2..f21c9ef 100644 --- a/whispersubs/__main__.py +++ b/whispersubs/__main__.py @@ -1,24 +1,25 @@ from __future__ import annotations import argparse +import contextlib import logging import os import sys import warnings -import contextlib from datetime import timedelta from itertools import chain from pathlib import Path from time import monotonic_ns -from typing import TYPE_CHECKING, Iterator, Iterable, Sequence, ContextManager +from typing import TYPE_CHECKING, ContextManager, Iterable, Iterator, Sequence import av -import numpy as np -from faster_whisper.transcribe import WhisperModel, Segment as WhisperSegment, TranscriptionInfo -from faster_whisper.utils import available_models -import srt import blessed import enlighten +import numpy as np +import srt +from faster_whisper.transcribe import Segment as WhisperSegment, TranscriptionInfo, WhisperModel +from faster_whisper.utils import available_models + if TYPE_CHECKING: from numpy.typing import NDArray @@ -34,9 +35,11 @@ _cudnn_libs = os.path.dirname(nvidia.cudnn.lib.__file__) _ld_library_path = os.environ.get("LD_LIBRARY_PATH", "") if _cudnn_libs not in _ld_library_path or _cublas_libs not in _ld_library_path: - os.environ["LD_LIBRARY_PATH"] = ":".join( - [_cublas_libs, _cudnn_libs, *_ld_library_path.split(":")] - ) + os.environ["LD_LIBRARY_PATH"] = ":".join([ + _cublas_libs, + _cudnn_libs, + *_ld_library_path.split(":"), + ]) # restart the script with the updated environment os.execve(sys.executable, [sys.executable] + sys.argv, os.environ)