diff options
| author | yum <yum.food.vr@gmail.com> | 2025-07-23 19:51:35 -0700 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2025-07-23 19:51:35 -0700 |
| commit | e1730a63538d2b1a23c948d25580612303733eba (patch) | |
| tree | 229caf417070ee7894422fc13da7d69de8a17af4 /app/stt.py | |
| parent | 9bf33a4cad8196bfe7253c841ab5c35ffdbc0173 (diff) | |
Update avg_logprob cutoff, fix sounds, fix electron build
Diffstat (limited to 'app/stt.py')
| -rw-r--r-- | app/stt.py | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -523,6 +523,13 @@ class Whisper: f"no_speech_prob={s.no_speech_prob}, " + f"avg_logprob={s.avg_logprob})", file=sys.stderr) continue + if s.avg_logprob < -0.75: + if self.cfg["enable_debug_mode"]: + print(f"Drop probable hallucination (case 3) " + + f"(text='{s.text}', " + + f"no_speech_prob={s.no_speech_prob}, " + + f"avg_logprob={s.avg_logprob})", file=sys.stderr) + continue if self.cfg["enable_debug_mode"]: print(f"s get: {s}") if s.avg_logprob < -1.0: @@ -686,7 +693,7 @@ class VadCommitter: if self.cfg["save_audio"] and len(delta) > 0: ts = datetime.fromtimestamp(self.collector.now() - latency_s) - filename = str(ts.strftime('%Y_%m_%d__%H-%M-%S')) + ".wav" + filename = str(ts.strftime('%Y_%m_%d__%H-%M-%S')) + delta.strip() + ".wav" audio_dir = os.path.join(PROJECT_ROOT, "audio") if not os.path.exists(audio_dir): os.makedirs(audio_dir) |
