mirror of
https://github.com/modelscope/FunASR
synced 2025-09-15 14:48:36 +08:00
fix export error if using cpu device; fix model path (#2265)
Co-authored-by: siyuan.yang <siyuan.yang@sophgo.com>
This commit is contained in:
parent
0c3c9be2c4
commit
46721dc84a
@ -2,7 +2,7 @@
|
||||
from funasr import AutoModel
|
||||
|
||||
model = AutoModel(
|
||||
model="/raid/t3cv/wangch/WORK_SAPCE/ASR/models/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-pytorch"
|
||||
model="iic/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-pytorch"
|
||||
)
|
||||
|
||||
res = model.export(type="onnx", quantize=False, opset_version=13, device='cuda') # fp32 onnx-gpu
|
||||
|
||||
@ -65,8 +65,9 @@ def _onnx(
|
||||
**kwargs,
|
||||
):
|
||||
|
||||
device = kwargs.get("device", "cpu")
|
||||
dummy_input = model.export_dummy_inputs()
|
||||
dummy_input = (dummy_input[0].to("cuda"), dummy_input[1].to("cuda"))
|
||||
dummy_input = (dummy_input[0].to(device), dummy_input[1].to(device))
|
||||
|
||||
|
||||
verbose = kwargs.get("verbose", False)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user