diff --git a/whisperlivekit/core.py b/whisperlivekit/core.py index e6e9893..7f10c84 100644 --- a/whisperlivekit/core.py +++ b/whisperlivekit/core.py @@ -57,6 +57,8 @@ class TranscriptionEngine: } transcription_common_params = update_with_kwargs(transcription_common_params, kwargs) + if transcription_common_params['model_size'].endswith(".en"): + transcription_common_params["lan"] = "en" if 'no_transcription' in kwargs: global_params['transcription'] = not global_params['no_transcription'] if 'no_vad' in kwargs: diff --git a/whisperlivekit/timed_objects.py b/whisperlivekit/timed_objects.py index caa5967..0637ed8 100644 --- a/whisperlivekit/timed_objects.py +++ b/whisperlivekit/timed_objects.py @@ -126,7 +126,7 @@ class Line(TimedText): def to_dict(self): _dict = { - 'speaker': abs(int(self.speaker)), + 'speaker': int(self.speaker) if self.speaker != -1 else 1, 'text': self.text, 'start': format_time(self.start), 'end': format_time(self.end), @@ -151,7 +151,7 @@ class FrontData(): def to_dict(self): _dict = { 'status': self.status, - 'lines': [line.to_dict() for line in self.lines if line.text], + 'lines': [line.to_dict() for line in self.lines if (line.text or line.speaker == -2)], 'buffer_transcription': self.buffer_transcription, 'buffer_diarization': self.buffer_diarization, 'remaining_time_transcription': self.remaining_time_transcription,