diff --git a/whisper_live/backend/openvino_backend.py b/whisper_live/backend/openvino_backend.py index 1d9586f..c072740 100644 --- a/whisper_live/backend/openvino_backend.py +++ b/whisper_live/backend/openvino_backend.py @@ -99,6 +99,20 @@ class ServeClientOpenVINO(ServeClientBase): logging.info(f"Using OpenVINO device: {self.device}") logging.info(f"Running OpenVINO backend with language: {self.language} and task: {self.task}") + def get_segment_end(self, segment): + """ + Override base class implementation to handle OpenVINO's end timestamp sentinel value. + + WhisperDecodedResultChunk.end_ts is -1.0 when the model did not predict an ending + timestamp (e.g. audio cut off mid-word). A negative end_ts causes a negative array + index in _identify_speaker(), producing an empty audio slice and silently disabling + diarization. Fall back to start_ts + 1.0 second in that case. + """ + end = getattr(segment, "end_ts", -1.0) + if end < 0: + return getattr(segment, "start_ts", 0) + 1.0 + return end + def create_model(self, model_id): """ Instantiates a new model, sets it as the transcriber.