From 144414fcf88de0b065f11bb8d830da7daaf62883 Mon Sep 17 00:00:00 2001 From: Apel-sin Date: Wed, 2 Apr 2025 15:29:27 +0300 Subject: [PATCH] add temperature param --- .gitignore | 3 ++- app/transcriber.py | 3 ++- config.json | 9 +++++---- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index f8f499f..2b369f8 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ __pycache__ models logs client.html -/history/* \ No newline at end of file +/history/* +config.json.v* \ No newline at end of file diff --git a/app/transcriber.py b/app/transcriber.py index 709d980..ca8345a 100644 --- a/app/transcriber.py +++ b/app/transcriber.py @@ -38,6 +38,7 @@ class WhisperTranscriber: self.batch_size = config["batch_size"] self.max_new_tokens = config["max_new_tokens"] self.return_timestamps = config["return_timestamps"] + self.temperature = config["temperature"] # Оптимальный тип для тензоров self.torch_dtype = torch.bfloat16 @@ -155,7 +156,7 @@ class WhisperTranscriber: # Транскрибация с корректным форматом данных result = self.asr_pipeline( {"raw": audio_array, "sampling_rate": sampling_rate}, - generate_kwargs={"language": self.language, "max_new_tokens": self.max_new_tokens}, + generate_kwargs={"language": self.language, "max_new_tokens": self.max_new_tokens, "temperature": self.temperature}, return_timestamps=self.return_timestamps ) diff --git a/config.json b/config.json index ec85d90..b67a2a8 100644 --- a/config.json +++ b/config.json @@ -1,13 +1,14 @@ { "service_port": 5042, - "model_path": "/mnt/cloud/llm/whisper/whisper-large-v3-russian-ties-podlodka", + "model_path": "/home/text-generation/models.whisper/antony-ties-podlodka-v1.2", "language": "russian", "enable_history": true, - "chunk_length_s": 25, - "batch_size": 20, + "chunk_length_s": 28, + "batch_size": 8, "max_new_tokens": 384, + "temperature": 0.01, "return_timestamps": false, "audio_rate": 8000, - "norm_level": "-0.5", + "norm_level": "-0.55", "compand_params": "0.3,1 -90,-90,-70,-50,-40,-15,0,0 -7 0 0.15" } \ No newline at end of file