Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
R1ckShi committed Jan 17, 2024
1 parent dcc310e commit b185783
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion funasr/auto/auto_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ def inference_with_vad(self, input, input_len=None, **cfg):
time_speech_total_per_sample = speech_lengths/16000
time_speech_total_all_samples += time_speech_total_per_sample

all_segments = []
for j, _ in enumerate(range(0, n)):
batch_size_ms_cum += (sorted_data[j][0][1] - sorted_data[j][0][0])
if j < n - 1 and (
Expand All @@ -320,7 +321,7 @@ def inference_with_vad(self, input, input_len=None, **cfg):
speech_j, speech_lengths_j = slice_padding_audio_samples(speech, speech_lengths, sorted_data[beg_idx:end_idx])
results = self.inference(speech_j, input_len=None, model=model, kwargs=kwargs, **cfg)
if self.spk_model is not None:
all_segments = []

# compose vad segments: [[start_time_sec, end_time_sec, speech], [...]]
for _b in range(len(speech_j)):
vad_segments = [[sorted_data[beg_idx:end_idx][_b][0][0]/1000.0, \
Expand Down

0 comments on commit b185783

Please sign in to comment.