update onnx codes

This commit is contained in:
维石 2024-07-22 15:36:01 +08:00
parent 0858308f36
commit cd94891c4a
4 changed files with 14 additions and 5 deletions

View File

@ -1,3 +1,8 @@
#!/usr/bin/env python3
# -*- encoding: utf-8 -*-
# Copyright FunASR (https://github.com/FunAudioLLM/SenseVoice). All Rights Reserved.
# MIT License (https://opensource.org/licenses/MIT)
from funasr import AutoModel
from funasr.utils.postprocess_utils import rich_transcription_postprocess

View File

@ -1,3 +1,8 @@
#!/usr/bin/env python3
# -*- encoding: utf-8 -*-
# Copyright FunASR (https://github.com/FunAudioLLM/SenseVoice). All Rights Reserved.
# MIT License (https://opensource.org/licenses/MIT)
from model import SenseVoiceSmall
from funasr.utils.postprocess_utils import rich_transcription_postprocess

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python3
# -*- encoding: utf-8 -*-
# Copyright FunASR (https://github.com/alibaba-damo-academy/FunASR). All Rights Reserved.
# Copyright FunASR (https://github.com/FunAudioLLM/SenseVoice). All Rights Reserved.
# MIT License (https://opensource.org/licenses/MIT)
import os
@ -44,4 +44,4 @@ wav_or_scp = "/Users/shixian/Downloads/asr_example_hotword.wav"
language_list = [0]
textnorm_list = [15]
res = model_bin(wav_or_scp, language_list, textnorm_list, tokenizer=tokenizer)
print(res)
print([rich_transcription_postprocess(i) for i in res])

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python3
# -*- encoding: utf-8 -*-
# Copyright FunASR (https://github.com/alibaba-damo-academy/FunASR). All Rights Reserved.
# Copyright FunASR (https://github.com/FunAudioLLM/SenseVoice). All Rights Reserved.
# MIT License (https://opensource.org/licenses/MIT)
import os.path
@ -18,9 +19,7 @@ from utils.infer_utils import (
get_logger,
read_yaml,
)
# from .utils.postprocess_utils import sentence_postprocess, sentence_postprocess_sentencepiece
from utils.frontend import WavFrontend
# from .utils.timestamp_utils import time_stamp_lfr6_onnx
from utils.infer_utils import pad_list
logging = get_logger()