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
449 stars 32 forks source link

TypeError: WhisperModel.transcribe() got an unexpected keyword argument 'hotwords' #38

Closed popcion closed 4 months ago

popcion commented 5 months ago

Traceback (most recent call last): File "G:\test\q.py", line 4, in lrcer.run(['q.mp3', 'w.mp3'], target_lang='zh-cn') File "F:\Program Files\Python-3.11.4\Lib\site-packages\openlrc\openlrc.py", line 320, in run producer.result() File "F:\Program Files\Python-3.11.4\Lib\concurrent\futures_base.py", line 456, in result return self.get_result() ^^^^^^^^^^^^^^^^^^^ File "F:\Program Files\Python-3.11.4\Lib\concurrent\futures_base.py", line 401, in get_result raise self._exception File "F:\Program Files\Python-3.11.4\Lib\concurrent\futures\thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "F:\Program Files\Python-3.11.4\Lib\site-packages\openlrc\openlrc.py", line 119, in transcription_producer segments, info = self.transcriber.transcribe(audio_path, language=src_lang) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "F:\Program Files\Python-3.11.4\Lib\site-packages\openlrc\transcribe.py", line 41, in transcribe seg_gen, info = self.whisper_model.transcribe(str(audio_path), language=language, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ photo_2024-05-22_02-26-34

zh-plus commented 5 months ago

Upgrade faster-whisper to the latest version using:

pip install -U faster-whisper
popcion commented 5 months ago

Solved. by the way, Glossary doesn't work, neither in .py files nor .yaml. when I translated from Japanese to Chinese. words do not remain the same eg. "おじさん">"爺爺"/“老頭”

lrcer = LRCer(glossary={ "おじさーん": "叔叔", "おじさん": "叔叔", })

zh-plus commented 5 months ago

A glossary primarily serves as a knowledge injection, providing abbreviations or preferred technical translations. For commonly used nouns, it will not change the models' minds.