Skip to content

Commit

Permalink
bumping increasing
Browse files Browse the repository at this point in the history
  • Loading branch information
Jemoka committed Feb 17, 2024
1 parent 0caa314 commit 7dd0bdc
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
22 changes: 16 additions & 6 deletions batchalign/pipelines/asr/whisperx.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@
import io
import os

try:
import whisperx

except ImportError:
raise ImportError("Cannot import WhisperX, please ensure it is installed.\nHint: run `pip install -U batchalign[whisperx]` or install WhisperX via instructions (https://github.com/m-bain/whisperX).")

import gc
import torch

Expand All @@ -34,6 +28,14 @@ class WhisperXEngine(BatchalignEngine):

def __init__(self, lang="eng"):

try:
import whisperx

except ImportError:
raise ImportError("Cannot import WhisperX, please ensure it is installed.\nHint: install WhisperX via instructions (https://github.com/m-bain/whisperX).")



language = pycountry.languages.get(alpha_3=lang).alpha_2

self.__lang = lang
Expand All @@ -56,6 +58,14 @@ def __init__(self, lang="eng"):
self.__engine = None

def generate(self, source_path, **kwargs):

try:
import whisperx

except ImportError:
raise ImportError("Cannot import WhisperX, please ensure it is installed.\nHint: run `pip install -U batchalign[whisperx]` or install WhisperX via instructions (https://github.com/m-bain/whisperX).")


# load audio
audio = whisperx.load_audio(source_path)

Expand Down
3 changes: 0 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@ def read(fname):
extras_require={
'dev': [
'pytest',
],
"whisperx": [
"whisperx @ git+ssh://[email protected]:m-bain/whisperX.git"
]
},
include_package_data=True,
Expand Down

0 comments on commit 7dd0bdc

Please sign in to comment.