csukuangfj commited on
Commit
bbf29cf
1 Parent(s): f2de7e7

Upload download-model.py

Browse files
Files changed (1) hide show
  1. download-model.py +28 -0
download-model.py ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+
3
+ # Please first run
4
+ # pip install modelscope
5
+
6
+ # See https://www.modelscope.cn/models/damo/speech_paraformer-large-vad-punc_asr_nat-zh-cn-16k-common-vocab8404-onnx/file/view/master/quickstart.md
7
+
8
+
9
+ from modelscope.hub.file_download import model_file_download
10
+
11
+ files = [
12
+ "model_quant.onnx",
13
+ "am.mvn",
14
+ "config.yaml",
15
+ "configuration.json",
16
+ ]
17
+ for f in files:
18
+ model_dir = model_file_download(
19
+ # model_id="damo/speech_paraformer-large-vad-punc_asr_nat-zh-cn-16k-common-vocab8404-onnx",
20
+ model_id="damo/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-pytorch",
21
+ file_path=f,
22
+ # revision="v1.2.4",
23
+ )
24
+ print(model_dir)
25
+
26
+ # /Users/fangjun/.cache/modelscope/hub/damo/speech_paraformer-large-vad-punc_asr_nat-zh-cn-16k-common-vocab8404-onnx/model_quant.onnx
27
+ #
28
+ # mv model_quant.onnx model.int8.onnx