카테고리 없음
[Stt] transformer stt ERROR 해결
3pie
2024. 2. 21. 14:12
ValueError: Multiple languages detected when trying to predict the most likely target language for transcription. It is currently not supported to transcribe to different languages in a single batch. Please make sure to either force a single language by passing `language='...'` or make sure all input audio is of the same language.
다양한 언어에 대해서 분석해야하는데 language를 지정하지 않으면 에러가 나서
result = self.pipe(sample, return_timestamps=True, generate_kwargs={"is_multilingual": True,
"logprob_threshold" : -1.0,
"compression_ratio_threshold" : 1.5,
"temperature" : 0.8,
"do_sample" : True,
"no_speech_threshold" : 0.6})
이렇게하니깐 간혹가다 단일배치에서는 타겟 언어를 설정해야한다고 에러가났다. 해서 언어지정을 해주니 에러가 안났지만, 언어 선택을 하면 어떤 언어가 와도 해당 언어로 번역하려는 기능이 whisper에 있기때문에 음성에서 언어 detect를 하고 지정 언어를 선택하는 로직을 추가해야할듯싶다.
result = self.pipe(sample, return_timestamps=True, generate_kwargs={"is_multilingual": True,
"language": "korean",
"logprob_threshold" : -1.0,
"compression_ratio_threshold" : 1.5,
"temperature" : 0.8,
"do_sample" : True,
"no_speech_threshold" : 0.6})