From a55125a7398120ad443e0f74b9745f592dc5b3dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C4=83zvan=20Purdel?= <104128753+rpurdel@users.noreply.github.com> Date: Wed, 7 Aug 2024 16:34:40 +0300 Subject: [PATCH] fix: correct final transcription id (#90) --- skynet/modules/stt/streaming_whisper/state.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/skynet/modules/stt/streaming_whisper/state.py b/skynet/modules/stt/streaming_whisper/state.py index 1fab066..d0bd1d3 100644 --- a/skynet/modules/stt/streaming_whisper/state.py +++ b/skynet/modules/stt/streaming_whisper/state.py @@ -188,10 +188,13 @@ def trim_working_audio(self, bytes_to_cut: int) -> bytes: def get_response_payload( self, transcription: str, start_timestamp: int, final_audio: bytes | None = None, final: bool = False ) -> utils.TranscriptionResponse: - if final: + if not self.transcription_id: self.transcription_id = str(self.uuid.get(start_timestamp)) + ts_id = self.transcription_id + if final: + self.transcription_id = '' return utils.TranscriptionResponse( - id=self.transcription_id, + id=ts_id, participant_id=self.participant_id, ts=start_timestamp, text=transcription,