zh-plus / openlrc

Transcribe and translate voice into LRC file using Whisper and LLMs (GPT, Claude, et,al). 使用whisper和LLM(GPT,Claude等)来转录、翻译你的音频为字幕文件。
https://zh-plus.github.io/openlrc/
MIT License
426 stars 28 forks source link

error when transcribe with faster-whisper==1.0.3 #51

Open MaleicAcid opened 2 months ago

MaleicAcid commented 2 months ago

This error only occurs when transcribe certain files(not all) with faster-whisper==1.0.3. If downgrade faster-whisper to 1.0.2 and it can be used normally.

 [2024-07-08 15:02:18] INFO     [MainThread] Start Transcription (Producer) and Translation (Consumer) process
 [2024-07-08 15:02:18] INFO     [Producer_0] Start Transcription process
 [2024-07-08 15:02:18] INFO     [Producer_0] Audio length: /input0/<dir-name>/preprocessed/<origin-audio-filename>_preprocessed.wav: 00:38:33,636
 [2024-07-08 15:02:21] INFO     [Producer_0] Processing audio with duration 38:33.636
 [2024-07-08 15:02:21] INFO     [Producer_0] Transcription process Elapsed: 2.66s
 [2024-07-08 15:02:21] INFO     [MainThread] Transcription (Producer) and Translation (Consumer) process Elapsed: 2.66s
Traceback (most recent call last):
  File "/output/src/transcribe.py", line 90, in <module>
    fire.Fire(TranscribeTask)
  File "/output/.venv/lib/python3.10/site-packages/fire/core.py", line 143, in Fire
    component_trace = _Fire(component, args, parsed_flag_args, context, name)
  File "/output/.venv/lib/python3.10/site-packages/fire/core.py", line 477, in _Fire
    component, remaining_args = _CallAndUpdateTrace(
  File "/output/.venv/lib/python3.10/site-packages/fire/core.py", line 693, in _CallAndUpdateTrace
    component = fn(*varargs, **kwargs)
  File "/output/src/transcribe.py", line 86, in run
    self.lrcer.run(self.audios, skip_trans=skip_trans, clear_temp=True)
  File "/output/.venv/lib/python3.10/site-packages/openlrc/openlrc.py", line 303, in run
    producer.result()
  File "/usr/local/lib/python3.10/concurrent/futures/_base.py", line 458, in result
    return self.__get_result()
  File "/usr/local/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
    raise self._exception
  File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/output/.venv/lib/python3.10/site-packages/openlrc/openlrc.py", line 119, in transcription_producer
    segments, info = self.transcriber.transcribe(audio_path, language=src_lang)
  File "/output/.venv/lib/python3.10/site-packages/openlrc/transcribe.py", line 41, in transcribe
    seg_gen, info = self.whisper_model.transcribe(str(audio_path), language=language,
  File "/output/.venv/lib/python3.10/site-packages/faster_whisper/transcribe.py", line 332, in transcribe
    vad_parameters = VadOptions(**vad_parameters)
TypeError: VadOptions.__new__() got an unexpected keyword argument 'window_size_samples'
zh-plus commented 2 months ago

Will be fixed in the next minor version.