👍️[Update] Model : whisperの設定項目を追加(avg_logprob, no_speech_prob)

This commit is contained in:
misyaguziya
2024-06-18 23:46:04 +09:00
parent 5178e5aeba
commit 01f73bc1f8
3 changed files with 64 additions and 4 deletions

View File

@@ -38,7 +38,7 @@ class AudioTranscriber:
self.whisper_model = getWhisperModel(root, whisper_weight_type)
self.transcription_engine = "Whisper"
def transcribeAudioQueue(self, audio_queue, language, country):
def transcribeAudioQueue(self, audio_queue, language, country, avg_logprob=-0.8, no_speech_prob=0.6):
if audio_queue.empty():
time.sleep(0.01)
return False
@@ -68,7 +68,7 @@ class AudioTranscriber:
vad_filter=False,
)
for s in segments:
if s.avg_logprob < -0.8 or s.no_speech_prob > 0.6:
if s.avg_logprob < avg_logprob or s.no_speech_prob > no_speech_prob:
continue
text += s.text