Fix ffmpeg overwrite and empty language fallback
- Add -y flag to ffmpeg to overwrite mkstemp-created empty temp files (ffmpeg exits 0 without writing when file exists and stdin is /dev/null) - Fix language fallback: use `or` instead of dict.get default so empty string from client falls back to config value - Fix language value in config: ru -> russian Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
ca2e41e0f5
commit
5b468c87f7
@@ -59,6 +59,7 @@ class AudioProcessor:
|
|||||||
"ffmpeg",
|
"ffmpeg",
|
||||||
"-hide_banner",
|
"-hide_banner",
|
||||||
"-loglevel", "warning",
|
"-loglevel", "warning",
|
||||||
|
"-y",
|
||||||
"-i", input_path,
|
"-i", input_path,
|
||||||
"-ar", f"{audio_rate}",
|
"-ar", f"{audio_rate}",
|
||||||
"-ac", "1", # Монофонический звук
|
"-ac", "1", # Монофонический звук
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ class TranscriptionService:
|
|||||||
Кортеж (JSON-ответ, HTTP-код).
|
Кортеж (JSON-ответ, HTTP-код).
|
||||||
"""
|
"""
|
||||||
params = params or {}
|
params = params or {}
|
||||||
language = params.get('language', self.config.get('language', 'en'))
|
language = params.get('language') or self.config.get('language', 'en')
|
||||||
temperature = max(0.0, min(1.0, float(params.get('temperature', 0.0))))
|
temperature = max(0.0, min(1.0, float(params.get('temperature', 0.0))))
|
||||||
prompt = params.get('prompt', '')
|
prompt = params.get('prompt', '')
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"service_port": 5042,
|
"service_port": 5042,
|
||||||
"model_path": "/home/text-generation/models/whisper/podlodka-turbo",
|
"model_path": "/home/text-generation/models/whisper/podlodka-turbo",
|
||||||
"language": "ru",
|
"language": "russian",
|
||||||
"enable_history": true,
|
"enable_history": true,
|
||||||
"max_history_days": 30,
|
"max_history_days": 30,
|
||||||
"chunk_length_s": 28,
|
"chunk_length_s": 28,
|
||||||
|
|||||||
Reference in New Issue
Block a user