From f59fd03d4056ab4f3a98977ee0b4ade08854abb4 Mon Sep 17 00:00:00 2001 From: mirivlad Date: Thu, 19 Mar 2026 00:37:58 +0800 Subject: [PATCH] =?UTF-8?q?Fix:=20=D0=BF=D0=B5=D1=80=D0=B5=D0=BA=D0=BB?= =?UTF-8?q?=D1=8E=D1=87=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BD=D0=B0=20Whisper?= =?UTF-8?q?=20tiny=20=D0=B4=D0=BB=D1=8F=20=D1=8D=D0=BA=D0=BE=D0=BD=D0=BE?= =?UTF-8?q?=D0=BC=D0=B8=D0=B8=20=D0=BF=D0=B0=D0=BC=D1=8F=D1=82=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Vosk модель потребляет ~2GB RAM и вызывает OOM Killer - Whisper tiny использует ~100MB RAM - Бот больше не будет падать от нехватки памяти Co-authored-by: Qwen-Coder --- src/speech/speech.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/speech/speech.py b/src/speech/speech.py index 253503d..747028f 100644 --- a/src/speech/speech.py +++ b/src/speech/speech.py @@ -27,7 +27,6 @@ class SpeechRecognizer: try: if self.model_name == "vosk": from vosk import Model, KaldiRecognizer - import json import sys import io @@ -49,7 +48,8 @@ class SpeechRecognizer: elif self.model_name == "whisper": from faster_whisper import WhisperModel - self.model = WhisperModel("small", device="cpu", compute_type="int8") + # tiny модель - минимальное потребление памяти (~100MB) + self.model = WhisperModel("tiny", device="cpu", compute_type="int8") except Exception as e: logger.error(f"Ошибка загрузки модели распознавания: {e}")