📂 Дополнительные материалы
- Тестирование: Файл для проверки узкой специализации модели вы можете найти в каталоге
Files.
- Альтернативная сборка: Облегченную Tiny-версию данной модели можно найти по ссылке: akimbabananan/whisper-tiny-ru-en-only.
English Version:
I completely understand why many find it frustrating that 99% of modern AI models, including this one, are trained for multilingual speech recognition. This creates an inconvenience for users who require specific languages for their target use cases. Here you will find a fully functional solution to this issue, including all the files required by both end-users and developers.

📂 Additional Resources
- Model Testing: You can find the sample file for testing the model's narrow specialization inside the
files directory.
- Alternative Build: A lightweight Tiny version of this model is available here: akimbabananan/whisper-tiny-ru-en-only.
🛠 Описание и технические особенности
Эта модель представляет собой глубоко специализированную версию OpenAI Whisper Base, прошедшую процедуру жесткого полноразмерного дообучения (Full Fine-Tuning). Архитектура полностью перестроена и оптимизирована для высокоточного распознавания речи (ASR) в строго изолированной двуязычной среде (Русский и Английский языки).
Концепция контролируемого забывания
Проект основан на концепции удаления избыточных языков из весов модели:
- Оптимизация: Путем отвязки декодера (
forced_decoder_ids = None) и 5000 шагов агрессивного обучения из модели были полностью вытеснены ассоциативные связи для 98 сторонних языков.
- Эффект языковой ловушки: Попытка подать на вход модели любой сторонний язык вызывает принудительную транслитерацию и перевод в русский или английский текст.
- Результат: Модель Whisper Base (~74M параметров) обеспечивает максимальную концентрацию на целевой паре языков. Идеальный показатель
eval_loss: 0.1929 был успешно достигнут на 4500-м шаге.
📊 Параметры обучения
- Датасет: Выборка аудиокниг объемом около 196 часов (комбинация LibriSpeech и Russian LibriSpeech) с сохранением исходной пунктуации.
- Оборудование: Обучение велось на одной видеокарте NVIDIA GeForce RTX 3060 (12 ГБ VRAM).
- Оптимизация: Применялись вычисления в полуточности FP16 и метод активации
gradient_checkpointing=True.
- Размер батча: Суммарный размер батча — 32 (8 физических на шаг, накопление градиента
gradient_accumulation_steps=4).
- Гиперпараметры: Оптимизатор с параметрами
learning_rate=5e-5 и warmup_steps=300.
🛠 Description and Technical Features
This model is a highly specialized version of OpenAI Whisper Base that has undergone a rigorous Full Fine-Tuning procedure. The architecture is fully optimized for high-precision Automatic Speech Recognition (ASR) within a strictly isolated bilingual environment (Russian and English).
The Concept of Controlled Forgetting
The project is built on the concept of removing redundant languages from the model weights:
- Optimization: By decoupling the decoder (
forced_decoder_ids = None) and applying 5000 steps of aggressive training, associative connections for 98 third-party languages were completely displaced from the model.
- Language Trap Effect: Any attempt to provide a foreign language input forces the model to transliterate or translate it directly into Russian or English text.
- Result: The Whisper Base model (~74M parameters) achieves maximum focus on the target language pair. An ideal
eval_loss of 0.1929 was successfully achieved at step 4500.
📊 Training Hyperparameters
- Dataset: An audiobook sample of approximately 196 hours (a combination of LibriSpeech and Russian LibriSpeech) with original punctuation preserved.
- Hardware: Training was performed on a single NVIDIA GeForce RTX 3060 (12 GB VRAM) GPU.
- Optimization: Mixed precision FP16 and
gradient_checkpointing=True activation method were applied.
- Batch Size: The total effective batch size is 32 (8 physical samples per step with
gradient_accumulation_steps=4).
- Hyperparameters: The optimizer was configured with
learning_rate=5e-5 and warmup_steps=300.
🚀 Базовый пример запуска
Скрипт для быстрого тестирования модели напрямую из репозитория Hugging Face:
🚀 Basic Usage Example
A script to quickly test the model directly from the Hugging Face repository:
import torch
import librosa
from transformers import WhisperProcessor, WhisperForConditionalGeneration
model_id = "akimbabananan/whisper-base-ru-en-only"
device = "cuda" if torch.cuda.is_available() else "cpu"
processor = WhisperProcessor.from_pretrained(model_id)
model = WhisperForConditionalGeneration.from_pretrained(model_id).to(device)
audio_path = "your_audio_file.wav"
audio_input, sampling_rate = librosa.load(audio_path, sr=16000)
input_features = processor(audio_input, sampling_rate=sampling_rate, return_tensors="pt").input_features.to(device)
forced_decoder_ids = processor.get_decoder_prompt_ids(language="russian", task="transcribe")
with torch.no_grad():
predicted_ids = model.generate(input_features, forced_decoder_ids=forced_decoder_ids)
transcription = processor.batch_decode(predicted_ids, skip_special_tokens=True)[0]
print(f"Результат распознавания: {transcription}")
License & Attribution
This model is a fine-tuned version of OpenAI's Whisper Tiny. Original model weights and architecture are subject to the MIT License by OpenAI.