add text ibest writer for SenseVoiceL

This commit is contained in:
志浩 2024-09-24 15:54:42 +08:00
parent d45230c6ba
commit 797bd57f91

View File

@ -1972,4 +1972,12 @@ class SenseVoiceL(nn.Module):
results.append(result_i)
ibest_writer = None
if kwargs.get("output_dir") is not None:
if not hasattr(self, "writer"):
self.writer = DatadirWriter(kwargs.get("output_dir"))
ibest_writer = self.writer[f"1best_recog"]
if ibest_writer is not None:
ibest_writer["text"][key[0]] = text
return results, meta_data