Skip to content

Commit

Permalink
fix: correct final transcription id (#90)
Browse files Browse the repository at this point in the history
  • Loading branch information
rpurdel authored Aug 7, 2024
1 parent 4f53f8d commit a55125a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions skynet/modules/stt/streaming_whisper/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit a55125a

Please sign in to comment.