From 3bf5b479472fbccfe834c4ad5e725eba1fad0fe6 Mon Sep 17 00:00:00 2001 From: makaveli10 Date: Mon, 22 Jan 2024 11:47:01 +0000 Subject: [PATCH] fix: server; remove debug stats --- whisper_live/server.py | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/whisper_live/server.py b/whisper_live/server.py index d9e976f..be0e959 100644 --- a/whisper_live/server.py +++ b/whisper_live/server.py @@ -120,11 +120,6 @@ class TranscriptionServer: websocket.close() del websocket return - - # validate custom model - if custom_model_path is not None and os.path.exists(custom_model_path): - logging.info(f"Using custom model {custom_model_path}") - options["model"] = custom_model_path if self.backend == "tensorrt": try: @@ -487,7 +482,7 @@ class ServeClientTensorRT(ServeClientBase): try: input_sample = input_bytes.copy() - + logging.info(f"[WhisperTensorRT:] Processing audio with duration: {duration}") mel, duration = self.transcriber.log_mel_spectrogram(input_sample) last_segment = self.transcriber.transcribe(mel) segments = [] @@ -496,7 +491,6 @@ class ServeClientTensorRT(ServeClientBase): segments = self.transcript[:].copy() else: segments = self.transcript[-self.send_last_n_segments:].copy() - print(self.transcript, len(self.transcript)) if last_segment is not None: segments.append({"text": last_segment}) try: @@ -508,17 +502,12 @@ class ServeClientTensorRT(ServeClientBase): ) if self.eos: - print("EOS is true: ", self.timestamp_offset, duration) if not len(self.transcript): self.transcript.append({"text": last_segment + " "}) elif self.transcript[-1]["text"].strip() != last_segment: self.transcript.append({"text": last_segment + " "}) self.timestamp_offset += duration - # self.set_eos(False) - # logging.info( - # f"[INFO:] Processed : {self.timestamp_offset} seconds / {self.frames_np.shape[0] / self.RATE} seconds" - # ) except Exception as e: logging.error(f"[ERROR]: {e}")