Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: transcribe() got an unexpected keyword argument 'repetition_penalty' #21

Closed
hhhynnn opened this issue Nov 23, 2023 · 2 comments

Comments

@hhhynnn
Copy link

hhhynnn commented Nov 23, 2023

执行 lrcer.run('./data/p1.mp3', arget_lang='zh-cn', skip_trans=True) 报错

Traceback (most recent call last):
File "/root/autodl-tmp/code/audio2text/openlrc_test.py", line 7, in
lrcer.run('./data/p1.mp3',
File "/root/miniconda3/envs/audio/lib/python3.9/site-packages/openlrc/openlrc.py", line 243, in run
producer.result()
File "/root/miniconda3/envs/audio/lib/python3.9/concurrent/futures/_base.py", line 446, in result
return self.__get_result()
File "/root/miniconda3/envs/audio/lib/python3.9/concurrent/futures/_base.py", line 391, in __get_result
raise self._exception
File "/root/miniconda3/envs/audio/lib/python3.9/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/root/miniconda3/envs/audio/lib/python3.9/site-packages/openlrc/openlrc.py", line 83, in transcription_producer
segments, info = self.transcriber.transcribe(audio_path, language=src_lang)
File "/root/miniconda3/envs/audio/lib/python3.9/site-packages/openlrc/transcribe.py", line 36, in transcribe
seg_gen, info = self.whisper_model.transcribe(str(audio_path), language=language,
TypeError: transcribe() got an unexpected keyword argument 'repetition_penalty

经过检查,0.2.3 版本 的 openlrc.py 里定义的 transcribe() 函数确实没有 repetition_penalty 参数

@hhhynnn
Copy link
Author

hhhynnn commented Nov 23, 2023

说错了,transcribe() 是 transcrib.py 里定义的,没有 repetition_penalty 参数是因为 faster-whipser 版本低,换成0.8.0就行了;

$ pip install faster-whisper==0.8.0

但是会有警告:
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
openlrc 0.2.3 requires faster-whisper<0.8.0,>=0.7.1, but you have faster-whisper 0.8.0 which is incompatible

也就是说跟着 README.md 一定会导致下载到错误的 faster-whisper 版本

@zh-plus
Copy link
Owner

zh-plus commented Nov 23, 2023

The faster-whisper dependency will be updated in the upcoming release. I'm still waiting for SYSTRAN/faster-whisper#548 to be merged.

@zh-plus zh-plus closed this as completed Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants