- Add threading.Lock around asr_pipeline calls (thread-safe inference on shared GPU) - Implement prompt parameter: propagate through process_file → transcribe → generate_kwargs - Fix prompt_ids device mismatch (.to(self.device) for CUDA) - Replace mkdtemp() with create_temp_file() in sources.py (no more leaked /tmp dirs) - Add max_history_days (default 30) with automatic cleanup of old history directories - Add intentional comments for SSRF and /config decisions (internal service) - Lower normalize_audio log level from INFO to DEBUG Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
26 lines
903 B
JSON
26 lines
903 B
JSON
{
|
|
"service_port": 5042,
|
|
"model_path": "/home/text-generation/models/whisper/podlodka-turbo",
|
|
"language": "ru",
|
|
"enable_history": true,
|
|
"max_history_days": 30,
|
|
"chunk_length_s": 28,
|
|
"batch_size": 6,
|
|
"max_new_tokens": 384,
|
|
"temperature": 0.01,
|
|
"return_timestamps": false,
|
|
"audio_rate": 16000,
|
|
"norm_level": "-0.55",
|
|
"compand_params": "0.3,1 -90,-90,-70,-50,-40,-15,0,0 -7 0 0.15",
|
|
"device_id": 0,
|
|
"file_validation": {
|
|
"max_file_size_mb": 500,
|
|
"allowed_extensions": [".wav", ".mp3", ".ogg", ".flac", ".m4a", ".oga", ".aac", ".webm"],
|
|
"allowed_mime_types": ["audio/wav", "audio/mpeg", "audio/ogg", "audio/flac", "audio/mp4", "audio/x-m4a", "audio/aac", "audio/webm"]
|
|
},
|
|
"log_level": "INFO",
|
|
"log_file": "logs/whisper_api.log",
|
|
"request_logging": {
|
|
"exclude_endpoints": ["/health", "/static"]
|
|
}
|
|
} |