m-bain / whisperX

WhisperX: Automatic Speech Recognition with Word-level Timestamps (& Diarization)
BSD 2-Clause "Simplified" License
12.44k stars 1.31k forks source link

--task translate not working properly #262

Open iAladeen opened 1 year ago

iAladeen commented 1 year ago

So after the new update --task translate command dosen't seem to be translating the text. It just gives the output in the same language as original. It also dosen't align the text with the audio, just gives text in short paragraphs test

arnavmehta7 commented 1 year ago

Yes I noticed this

JettScythe commented 9 months ago

8 months later....

TheTerrasque commented 5 months ago

There's a bug in line 176 in whisperx/transcribe.py

Patch:

diff --git a/whisperx/transcribe.py b/whisperx/transcribe.py
index edd2764..818179a 100644
--- a/whisperx/transcribe.py
+++ b/whisperx/transcribe.py
@@ -173,7 +173,7 @@ def cli():
         audio = load_audio(audio_path)
         # >> VAD & ASR
         print(">>Performing transcription...")
-        result = model.transcribe(audio, batch_size=batch_size, chunk_size=chunk_size, print_progress=print_progress)
+        result = model.transcribe(audio, batch_size=batch_size, chunk_size=chunk_size, print_progress=print_progress, task=task)
         results.append((result, audio_path))

     # Unload Whisper and VAD

Without it, task only gets set if the language is passed as a command line option. (transcribe.py:170 -> asr.py:294)