| | |
| | | from modelscope.pipelines import pipeline |
| | | from modelscope.utils.constant import Tasks |
| | | from modelscope.utils.logger import get_logger |
| | | import logging |
| | | logger = get_logger(log_level=logging.CRITICAL) |
| | | logger.setLevel(logging.CRITICAL) |
| | | import soundfile |
| | | |
| | | |
| | | if __name__ == '__main__': |
| | | output_dir = None |
| | |
| | | sample_offset = 0 |
| | | |
| | | step = 160 * 10 |
| | | param_dict = {'in_cache': dict()} |
| | | param_dict = {'in_cache': dict(), 'max_end_sil': 800} |
| | | for sample_offset in range(0, speech_length, min(step, speech_length - sample_offset)): |
| | | if sample_offset + step >= speech_length - 1: |
| | | step = speech_length - sample_offset |