Skip to content

Commit

Permalink
silent whisperx
Browse files Browse the repository at this point in the history
  • Loading branch information
Jemoka committed Feb 17, 2024
1 parent 426dfeb commit e16bf74
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
16 changes: 7 additions & 9 deletions batchalign/pipelines/asr/whisperx.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
import os

try:
with silence():
import whisperx
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).")
Expand All @@ -41,13 +40,12 @@ def __init__(self, lang="eng"):
self.__lang_code = language

L.info("Loading (and possibly downloading) WhisperX models...")
with silence():
self.__model = whisperx.load_model("large-v2", device=DEVICE,
compute_type=("float16"
if DEVICE == "cuda" else "float32"),
language=language)
self.__fa, self.__meta = whisperx.load_align_model(device=DEVICE,
language_code=language)
self.__model = whisperx.load_model("large-v2", device=DEVICE,
compute_type=("float16"
if DEVICE == "cuda" else "float32"),
language=language)
self.__fa, self.__meta = whisperx.load_align_model(device=DEVICE,
language_code=language)
L.info("Done loading WhisperX models!")

if POSTPROCESSOR_LANGS.get(self.__lang) != None:
Expand Down
2 changes: 1 addition & 1 deletion batchalign/version
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
0.5.1-beta.0
0.5.1-beta.1
Feb 16th, 2024
Beta WhisperX support

0 comments on commit e16bf74

Please sign in to comment.