Skip to content

Commit

Permalink
fixing whisper
Browse files Browse the repository at this point in the history
  • Loading branch information
Jemoka committed Feb 23, 2024
1 parent 0a5b848 commit 7143ecc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
15 changes: 8 additions & 7 deletions batchalign/pipelines/asr/whisperx.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def __init__(self, lang="eng"):

try:
import whisperx

print("Batchalign: If you got a warning about pyannote versioning, bad things will not happen. Please disregard.")
except ImportError:
raise ImportError("Cannot import WhisperX, please ensure it is installed.\nHint: install WhisperX by running `pip install git+https://github.com/m-bain/whisperx.git`.")

Expand Down Expand Up @@ -83,12 +83,13 @@ def generate(self, source_path, **kwargs):
for word in segment["words"]:
stripped = word["word"].translate(str.maketrans('', '', string.punctuation)).strip()
if stripped != "":
text = {
"type": "text",
"ts": word["start"],
"end_ts": word["end"],
"value": stripped,
}
if word.get("start") != None and word.get("end") != None:
text = {
"type": "text",
"ts": word["start"],
"end_ts": word["end"],
"value": stripped,
}

current_turn.append(text)

Expand Down
4 changes: 2 additions & 2 deletions batchalign/version
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
0.5.2-beta.0
0.5.2-beta.1
Feb 16th, 2024
Disable MWT for GA
Whisperx fixes

0 comments on commit 7143ecc

Please sign in to comment.