Simplify architecture: remove overengineering, flatten structure
- Remove dead code: cache.py, context_managers.py, decorators.py, flask-limiter - Replace AudioSource ABC + FakeFile (5 classes) with 4 plain functions - Replace TempFileManager class with create_temp_file/cleanup_temp_files functions - Simplify RequestLogger from 233 to 65 lines, remove file reading side-effect - Convert HistoryLogger and AudioUtils classes to module-level functions - Remove unused speed_up_audio and audio_speed_factor config - Flatten single-file directories: shared/, api/, storage/, validation/, async_tasks/, logging/ - Merge logging config + request_logger into single infrastructure/log.py - Fix request_logging config key (was request_logger) - Trim CLAUDE.md to high-level only Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
38785398b3
commit
2e2bad8255
@@ -20,8 +20,8 @@ from transformers import (
|
||||
)
|
||||
|
||||
from ..audio.processor import AudioProcessor
|
||||
from ..audio.utils import AudioUtils
|
||||
from ..infrastructure.storage.file_manager import temp_file_manager
|
||||
from ..audio.utils import load_audio
|
||||
from ..infrastructure.storage import cleanup_temp_files
|
||||
|
||||
logger = logging.getLogger('app.transcriber')
|
||||
|
||||
@@ -177,7 +177,7 @@ class WhisperTranscriber:
|
||||
|
||||
try:
|
||||
# Загрузка аудио в формате numpy array
|
||||
audio_array, sampling_rate = AudioUtils.load_audio(audio_path, sr=16000)
|
||||
audio_array, sampling_rate = load_audio(audio_path, sr=16000)
|
||||
|
||||
# Транскрибация с корректным форматом данных
|
||||
result = self.asr_pipeline(
|
||||
@@ -279,4 +279,4 @@ class WhisperTranscriber:
|
||||
|
||||
finally:
|
||||
# Очистка временных файлов
|
||||
temp_file_manager.cleanup_temp_files(temp_files)
|
||||
cleanup_temp_files(temp_files)
|
||||
Reference in New Issue
Block a user