From a41e714801f64f31a1033828f2e1e3fd24389be8 Mon Sep 17 00:00:00 2001 From: makaveli10 Date: Mon, 26 Feb 2024 23:31:19 -0500 Subject: [PATCH] fix: lanuguage, task prefix in decoder start ids --- whisper_live/server.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/whisper_live/server.py b/whisper_live/server.py index 7bebe39..9cc2bb5 100644 --- a/whisper_live/server.py +++ b/whisper_live/server.py @@ -575,7 +575,7 @@ class ServeClientTensorRT(ServeClientBase): warmup_steps (int): Number of steps to warm up the model for. """ logging.info("[INFO:] Warming up TensorRT engine..") - mel, _ = self.transcriber.log_mel_spectrogram("tests/jfk.flac") + mel, _ = self.transcriber.log_mel_spectrogram("assets/jfk.flac") for i in range(warmup_steps): self.transcriber.transcribe(mel) @@ -613,7 +613,10 @@ class ServeClientTensorRT(ServeClientBase): """ logging.info(f"[WhisperTensorRT:] Processing audio with duration: {input_bytes.shape[0] / self.RATE}") mel, duration = self.transcriber.log_mel_spectrogram(input_bytes) - last_segment = self.transcriber.transcribe(mel) + last_segment = self.transcriber.transcribe( + mel, + text_prefix=f"<|startoftranscript|><|{self.language}|><|{self.task}|><|notimestamps|>" + ) if last_segment: self.handle_transcription_output(last_segment, duration)