speech_asr
2023-03-15 2cfe010d7b0f17877a271cc401e2c2f8f8d4c42c
update
1个文件已修改
5 ■■■■■ 已修改文件
funasr/bin/eend_ola_inference.py 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
funasr/bin/eend_ola_inference.py
@@ -27,6 +27,8 @@
from funasr.utils.types import str2triple_str
from funasr.utils.types import str_or_none
from modelscope.utils.logger import get_logger
logger = get_logger()
class Speech2Diarization:
    """Speech2Diarlization class
@@ -209,6 +211,7 @@
            if isinstance(raw_inputs, torch.Tensor):
                raw_inputs = raw_inputs.numpy()
            data_path_and_name_and_type = [raw_inputs, "speech", "waveform"]
        logger.info(data_path_and_name_and_type)
        loader = EENDOLADiarTask.build_streaming_iterator(
            data_path_and_name_and_type,
            dtype=dtype,
@@ -228,6 +231,8 @@
            output_writer = open("{}/result.txt".format(output_path), "w")
        result_list = []
        for keys, batch in loader:
            logger.info("keys: {}".format(keys))
            logger.info("batch: {}".format(batch))
            assert isinstance(batch, dict), type(batch)
            assert all(isinstance(s, str) for s in keys), keys
            _bs = len(next(iter(batch.values())))