Skip to content

Commit

Permalink
fix: apply pre-commit automatic fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
andreabak committed Mar 16, 2024
1 parent cd632d3 commit 470d76c
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 15 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Library.
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
pre-commit
hatch
pre-commit
8 changes: 4 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pyav
faster-whisper
srt
numpy
blessed
enlighten
faster-whisper
numpy
pyav
srt
21 changes: 12 additions & 9 deletions whispersubs/__main__.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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)

Expand Down

0 comments on commit 470d76c

Please sign in to comment.