Skip to content

Commit

Permalink
update onnx codes
Browse files Browse the repository at this point in the history
  • Loading branch information
R1ckShi committed Jul 22, 2024
1 parent 0858308 commit cd94891
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
5 changes: 5 additions & 0 deletions demo1.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
5 changes: 5 additions & 0 deletions demo2.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
4 changes: 2 additions & 2 deletions export.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -44,4 +44,4 @@
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])
5 changes: 2 additions & 3 deletions utils/model_bin.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -18,9 +19,7 @@
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()
Expand Down

0 comments on commit cd94891

Please sign in to comment.