Skip to content

Commit

Permalink
fix: lanuguage, task prefix in decoder start ids
Browse files Browse the repository at this point in the history
  • Loading branch information
makaveli10 committed Feb 27, 2024
1 parent 2d16ee5 commit a41e714
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions whisper_live/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ def warmup(self, warmup_steps=10):
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)

Expand Down Expand Up @@ -613,7 +613,10 @@ def transcribe_audio(self, input_bytes):
"""
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)

Expand Down

0 comments on commit a41e714

Please sign in to comment.