force language = en for .en models
This commit is contained in:
parent
d080d675a8
commit
ca6f9246cc
2 changed files with 4 additions and 2 deletions
|
|
@ -57,6 +57,8 @@ class TranscriptionEngine:
|
||||||
}
|
}
|
||||||
transcription_common_params = update_with_kwargs(transcription_common_params, kwargs)
|
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:
|
if 'no_transcription' in kwargs:
|
||||||
global_params['transcription'] = not global_params['no_transcription']
|
global_params['transcription'] = not global_params['no_transcription']
|
||||||
if 'no_vad' in kwargs:
|
if 'no_vad' in kwargs:
|
||||||
|
|
|
||||||
|
|
@ -126,7 +126,7 @@ class Line(TimedText):
|
||||||
|
|
||||||
def to_dict(self):
|
def to_dict(self):
|
||||||
_dict = {
|
_dict = {
|
||||||
'speaker': abs(int(self.speaker)),
|
'speaker': int(self.speaker) if self.speaker != -1 else 1,
|
||||||
'text': self.text,
|
'text': self.text,
|
||||||
'start': format_time(self.start),
|
'start': format_time(self.start),
|
||||||
'end': format_time(self.end),
|
'end': format_time(self.end),
|
||||||
|
|
@ -151,7 +151,7 @@ class FrontData():
|
||||||
def to_dict(self):
|
def to_dict(self):
|
||||||
_dict = {
|
_dict = {
|
||||||
'status': self.status,
|
'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_transcription': self.buffer_transcription,
|
||||||
'buffer_diarization': self.buffer_diarization,
|
'buffer_diarization': self.buffer_diarization,
|
||||||
'remaining_time_transcription': self.remaining_time_transcription,
|
'remaining_time_transcription': self.remaining_time_transcription,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue