csukuangfj commited on
Commit
37955bf
·
1 Parent(s): 838aa85

update model

Browse files
bar/decoder_jit_trace-v2-iter-468000-avg-16-pnnx.ncnn.bin CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:01787e159327815555f1a8d589c0bd43e5cb609b120de5ec554a2c7d4e1a3583
3
  size 514056
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d85e49679bb4993e7f87516e3d0a6dde13a833930cafd092aa41e10c1b94d0cf
3
  size 514056
bar/encoder_jit_trace-v2-iter-468000-avg-16-pnnx.ncnn.bin CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:00a19320bbf51235a0ee7a744533c7d2eaae6d26a57640cdd21c87aeeea8accf
3
  size 166239840
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1e4f42320511992a8e39586286498d3a7950621f5952bee0671aa7fb972236d6
3
  size 166239840
bar/encoder_jit_trace-v2-iter-468000-avg-16-pnnx.ncnn.param CHANGED
@@ -1,5 +1,6 @@
1
  7767517
2
- 267 379
 
3
  Input in0 0 1 in0
4
  Input in1 0 1 in1
5
  Input in2 0 1 in2
@@ -28,7 +29,7 @@ InnerProduct linear_18 1 1 48 49 0=512 1=1 2=1179648
28
  Split splitncnn_5 1 3 49 50 51 52
29
  BinaryOp mul_6 2 1 50 51 53 0=2
30
  Reduction mean_80 1 1 53 54 0=3 1=0 -23303=1,-1 4=1 5=1
31
- BinaryOp add_7 1 1 54 55 0=0 1=1 2=2.499987e-01
32
  BinaryOp pow_8 1 1 55 56 0=6 1=1 2=-5.000000e-01
33
  BinaryOp mul_9 2 1 52 56 57 0=2
34
  BinaryOp sub_10 1 1 in1 58 0=1 1=1 2=3.000000e+00
@@ -53,7 +54,7 @@ BinaryOp add_19 2 1 72 80 81 0=0
53
  Split splitncnn_9 1 3 81 82 83 84
54
  BinaryOp mul_20 2 1 82 83 85 0=2
55
  Reduction mean_81 1 1 85 86 0=3 1=0 -23303=1,-1 4=1 5=1
56
- BinaryOp add_21 1 1 86 87 0=0 1=1 2=1.285161e+00
57
  BinaryOp pow_22 1 1 87 88 0=6 1=1 2=-5.000000e-01
58
  BinaryOp mul_23 2 1 84 88 89 0=2
59
  Split splitncnn_10 1 2 89 90 91
@@ -72,7 +73,7 @@ BinaryOp add_27 2 1 98 106 107 0=0
72
  Split splitncnn_13 1 3 107 108 109 110
73
  BinaryOp mul_28 2 1 108 109 111 0=2
74
  Reduction mean_82 1 1 111 112 0=3 1=0 -23303=1,-1 4=1 5=1
75
- BinaryOp add_29 1 1 112 113 0=0 1=1 2=1.770352e+00
76
  BinaryOp pow_30 1 1 113 114 0=6 1=1 2=-5.000000e-01
77
  BinaryOp mul_31 2 1 110 114 115 0=2
78
  Split splitncnn_14 1 2 115 116 117
@@ -91,7 +92,7 @@ BinaryOp add_35 2 1 124 132 133 0=0
91
  Split splitncnn_17 1 3 133 134 135 136
92
  BinaryOp mul_36 2 1 134 135 137 0=2
93
  Reduction mean_83 1 1 137 138 0=3 1=0 -23303=1,-1 4=1 5=1
94
- BinaryOp add_37 1 1 138 139 0=0 1=1 2=2.005826e+00
95
  BinaryOp pow_38 1 1 139 140 0=6 1=1 2=-5.000000e-01
96
  BinaryOp mul_39 2 1 136 140 141 0=2
97
  Split splitncnn_18 1 2 141 142 143
@@ -110,7 +111,7 @@ BinaryOp add_43 2 1 150 158 159 0=0
110
  Split splitncnn_21 1 3 159 160 161 162
111
  BinaryOp mul_44 2 1 160 161 163 0=2
112
  Reduction mean_84 1 1 163 164 0=3 1=0 -23303=1,-1 4=1 5=1
113
- BinaryOp add_45 1 1 164 165 0=0 1=1 2=1.877999e+00
114
  BinaryOp pow_46 1 1 165 166 0=6 1=1 2=-5.000000e-01
115
  BinaryOp mul_47 2 1 162 166 167 0=2
116
  Split splitncnn_22 1 2 167 168 169
@@ -129,7 +130,7 @@ BinaryOp add_51 2 1 176 184 185 0=0
129
  Split splitncnn_25 1 3 185 186 187 188
130
  BinaryOp mul_52 2 1 186 187 189 0=2
131
  Reduction mean_85 1 1 189 190 0=3 1=0 -23303=1,-1 4=1 5=1
132
- BinaryOp add_53 1 1 190 191 0=0 1=1 2=2.357182e+00
133
  BinaryOp pow_54 1 1 191 192 0=6 1=1 2=-5.000000e-01
134
  BinaryOp mul_55 2 1 188 192 193 0=2
135
  Split splitncnn_26 1 2 193 194 195
@@ -148,7 +149,7 @@ BinaryOp add_59 2 1 202 210 211 0=0
148
  Split splitncnn_29 1 3 211 212 213 214
149
  BinaryOp mul_60 2 1 212 213 215 0=2
150
  Reduction mean_86 1 1 215 216 0=3 1=0 -23303=1,-1 4=1 5=1
151
- BinaryOp add_61 1 1 216 217 0=0 1=1 2=2.294552e+00
152
  BinaryOp pow_62 1 1 217 218 0=6 1=1 2=-5.000000e-01
153
  BinaryOp mul_63 2 1 214 218 219 0=2
154
  Split splitncnn_30 1 2 219 220 221
@@ -167,7 +168,7 @@ BinaryOp add_67 2 1 228 236 237 0=0
167
  Split splitncnn_33 1 3 237 238 239 240
168
  BinaryOp mul_68 2 1 238 239 241 0=2
169
  Reduction mean_87 1 1 241 242 0=3 1=0 -23303=1,-1 4=1 5=1
170
- BinaryOp add_69 1 1 242 243 0=0 1=1 2=3.318981e+00
171
  BinaryOp pow_70 1 1 243 244 0=6 1=1 2=-5.000000e-01
172
  BinaryOp mul_71 2 1 240 244 245 0=2
173
  Split splitncnn_34 1 2 245 246 247
@@ -186,7 +187,7 @@ BinaryOp add_75 2 1 254 262 263 0=0
186
  Split splitncnn_37 1 3 263 264 265 266
187
  BinaryOp mul_76 2 1 264 265 267 0=2
188
  Reduction mean_88 1 1 267 268 0=3 1=0 -23303=1,-1 4=1 5=1
189
- BinaryOp add_77 1 1 268 269 0=0 1=1 2=2.019367e+00
190
  BinaryOp pow_78 1 1 269 270 0=6 1=1 2=-5.000000e-01
191
  BinaryOp mul_79 2 1 266 270 271 0=2
192
  Split splitncnn_38 1 2 271 272 273
@@ -205,7 +206,7 @@ BinaryOp add_83 2 1 280 288 289 0=0
205
  Split splitncnn_41 1 3 289 290 291 292
206
  BinaryOp mul_84 2 1 290 291 293 0=2
207
  Reduction mean_89 1 1 293 294 0=3 1=0 -23303=1,-1 4=1 5=1
208
- BinaryOp add_85 1 1 294 295 0=0 1=1 2=2.291728e+00
209
  BinaryOp pow_86 1 1 295 296 0=6 1=1 2=-5.000000e-01
210
  BinaryOp mul_87 2 1 292 296 297 0=2
211
  Split splitncnn_42 1 2 297 298 299
@@ -224,7 +225,7 @@ BinaryOp add_91 2 1 306 314 315 0=0
224
  Split splitncnn_45 1 3 315 316 317 318
225
  BinaryOp mul_92 2 1 316 317 319 0=2
226
  Reduction mean_90 1 1 319 320 0=3 1=0 -23303=1,-1 4=1 5=1
227
- BinaryOp add_93 1 1 320 321 0=0 1=1 2=1.188224e+00
228
  BinaryOp pow_94 1 1 321 322 0=6 1=1 2=-5.000000e-01
229
  BinaryOp mul_95 2 1 318 322 323 0=2
230
  Split splitncnn_46 1 2 323 324 325
@@ -243,7 +244,7 @@ BinaryOp add_99 2 1 332 340 341 0=0
243
  Split splitncnn_49 1 3 341 342 343 344
244
  BinaryOp mul_100 2 1 342 343 345 0=2
245
  Reduction mean_91 1 1 345 346 0=3 1=0 -23303=1,-1 4=1 5=1
246
- BinaryOp add_101 1 1 346 347 0=0 1=1 2=1.185556e+00
247
  BinaryOp pow_102 1 1 347 348 0=6 1=1 2=-5.000000e-01
248
  BinaryOp mul_103 2 1 344 348 349 0=2
249
  Split splitncnn_50 1 2 349 350 351
@@ -262,7 +263,7 @@ BinaryOp add_107 2 1 358 366 367 0=0
262
  Split splitncnn_53 1 3 367 368 369 370
263
  BinaryOp mul_108 2 1 368 369 371 0=2
264
  Reduction mean_92 1 1 371 372 0=3 1=0 -23303=1,-1 4=1 5=1
265
- BinaryOp add_109 1 1 372 373 0=0 1=1 2=1.118955e+00
266
  BinaryOp pow_110 1 1 373 374 0=6 1=1 2=-5.000000e-01
267
  BinaryOp mul_111 2 1 370 374 out0 0=2
268
  Concat cat_0 12 1 70 96 122 148 174 200 226 252 278 304 330 356 out3 0=0
 
1
  7767517
2
+ 268 379
3
+ SherpaMetaData sherpa_meta_data1 0 0 0=3 1=12 2=512 3=1024
4
  Input in0 0 1 in0
5
  Input in1 0 1 in1
6
  Input in2 0 1 in2
 
29
  Split splitncnn_5 1 3 49 50 51 52
30
  BinaryOp mul_6 2 1 50 51 53 0=2
31
  Reduction mean_80 1 1 53 54 0=3 1=0 -23303=1,-1 4=1 5=1
32
+ BinaryOp add_7 1 1 54 55 0=0 1=1 2=2.499982e-01
33
  BinaryOp pow_8 1 1 55 56 0=6 1=1 2=-5.000000e-01
34
  BinaryOp mul_9 2 1 52 56 57 0=2
35
  BinaryOp sub_10 1 1 in1 58 0=1 1=1 2=3.000000e+00
 
54
  Split splitncnn_9 1 3 81 82 83 84
55
  BinaryOp mul_20 2 1 82 83 85 0=2
56
  Reduction mean_81 1 1 85 86 0=3 1=0 -23303=1,-1 4=1 5=1
57
+ BinaryOp add_21 1 1 86 87 0=0 1=1 2=1.285091e+00
58
  BinaryOp pow_22 1 1 87 88 0=6 1=1 2=-5.000000e-01
59
  BinaryOp mul_23 2 1 84 88 89 0=2
60
  Split splitncnn_10 1 2 89 90 91
 
73
  Split splitncnn_13 1 3 107 108 109 110
74
  BinaryOp mul_28 2 1 108 109 111 0=2
75
  Reduction mean_82 1 1 111 112 0=3 1=0 -23303=1,-1 4=1 5=1
76
+ BinaryOp add_29 1 1 112 113 0=0 1=1 2=1.768978e+00
77
  BinaryOp pow_30 1 1 113 114 0=6 1=1 2=-5.000000e-01
78
  BinaryOp mul_31 2 1 110 114 115 0=2
79
  Split splitncnn_14 1 2 115 116 117
 
92
  Split splitncnn_17 1 3 133 134 135 136
93
  BinaryOp mul_36 2 1 134 135 137 0=2
94
  Reduction mean_83 1 1 137 138 0=3 1=0 -23303=1,-1 4=1 5=1
95
+ BinaryOp add_37 1 1 138 139 0=0 1=1 2=2.004356e+00
96
  BinaryOp pow_38 1 1 139 140 0=6 1=1 2=-5.000000e-01
97
  BinaryOp mul_39 2 1 136 140 141 0=2
98
  Split splitncnn_18 1 2 141 142 143
 
111
  Split splitncnn_21 1 3 159 160 161 162
112
  BinaryOp mul_44 2 1 160 161 163 0=2
113
  Reduction mean_84 1 1 163 164 0=3 1=0 -23303=1,-1 4=1 5=1
114
+ BinaryOp add_45 1 1 164 165 0=0 1=1 2=1.876125e+00
115
  BinaryOp pow_46 1 1 165 166 0=6 1=1 2=-5.000000e-01
116
  BinaryOp mul_47 2 1 162 166 167 0=2
117
  Split splitncnn_22 1 2 167 168 169
 
130
  Split splitncnn_25 1 3 185 186 187 188
131
  BinaryOp mul_52 2 1 186 187 189 0=2
132
  Reduction mean_85 1 1 189 190 0=3 1=0 -23303=1,-1 4=1 5=1
133
+ BinaryOp add_53 1 1 190 191 0=0 1=1 2=2.354979e+00
134
  BinaryOp pow_54 1 1 191 192 0=6 1=1 2=-5.000000e-01
135
  BinaryOp mul_55 2 1 188 192 193 0=2
136
  Split splitncnn_26 1 2 193 194 195
 
149
  Split splitncnn_29 1 3 211 212 213 214
150
  BinaryOp mul_60 2 1 212 213 215 0=2
151
  Reduction mean_86 1 1 215 216 0=3 1=0 -23303=1,-1 4=1 5=1
152
+ BinaryOp add_61 1 1 216 217 0=0 1=1 2=2.291315e+00
153
  BinaryOp pow_62 1 1 217 218 0=6 1=1 2=-5.000000e-01
154
  BinaryOp mul_63 2 1 214 218 219 0=2
155
  Split splitncnn_30 1 2 219 220 221
 
168
  Split splitncnn_33 1 3 237 238 239 240
169
  BinaryOp mul_68 2 1 238 239 241 0=2
170
  Reduction mean_87 1 1 241 242 0=3 1=0 -23303=1,-1 4=1 5=1
171
+ BinaryOp add_69 1 1 242 243 0=0 1=1 2=3.315238e+00
172
  BinaryOp pow_70 1 1 243 244 0=6 1=1 2=-5.000000e-01
173
  BinaryOp mul_71 2 1 240 244 245 0=2
174
  Split splitncnn_34 1 2 245 246 247
 
187
  Split splitncnn_37 1 3 263 264 265 266
188
  BinaryOp mul_76 2 1 264 265 267 0=2
189
  Reduction mean_88 1 1 267 268 0=3 1=0 -23303=1,-1 4=1 5=1
190
+ BinaryOp add_77 1 1 268 269 0=0 1=1 2=2.017090e+00
191
  BinaryOp pow_78 1 1 269 270 0=6 1=1 2=-5.000000e-01
192
  BinaryOp mul_79 2 1 266 270 271 0=2
193
  Split splitncnn_38 1 2 271 272 273
 
206
  Split splitncnn_41 1 3 289 290 291 292
207
  BinaryOp mul_84 2 1 290 291 293 0=2
208
  Reduction mean_89 1 1 293 294 0=3 1=0 -23303=1,-1 4=1 5=1
209
+ BinaryOp add_85 1 1 294 295 0=0 1=1 2=2.289504e+00
210
  BinaryOp pow_86 1 1 295 296 0=6 1=1 2=-5.000000e-01
211
  BinaryOp mul_87 2 1 292 296 297 0=2
212
  Split splitncnn_42 1 2 297 298 299
 
225
  Split splitncnn_45 1 3 315 316 317 318
226
  BinaryOp mul_92 2 1 316 317 319 0=2
227
  Reduction mean_90 1 1 319 320 0=3 1=0 -23303=1,-1 4=1 5=1
228
+ BinaryOp add_93 1 1 320 321 0=0 1=1 2=1.186822e+00
229
  BinaryOp pow_94 1 1 321 322 0=6 1=1 2=-5.000000e-01
230
  BinaryOp mul_95 2 1 318 322 323 0=2
231
  Split splitncnn_46 1 2 323 324 325
 
244
  Split splitncnn_49 1 3 341 342 343 344
245
  BinaryOp mul_100 2 1 342 343 345 0=2
246
  Reduction mean_91 1 1 345 346 0=3 1=0 -23303=1,-1 4=1 5=1
247
+ BinaryOp add_101 1 1 346 347 0=0 1=1 2=1.183580e+00
248
  BinaryOp pow_102 1 1 347 348 0=6 1=1 2=-5.000000e-01
249
  BinaryOp mul_103 2 1 344 348 349 0=2
250
  Split splitncnn_50 1 2 349 350 351
 
263
  Split splitncnn_53 1 3 367 368 369 370
264
  BinaryOp mul_108 2 1 368 369 371 0=2
265
  Reduction mean_92 1 1 371 372 0=3 1=0 -23303=1,-1 4=1 5=1
266
+ BinaryOp add_109 1 1 372 373 0=0 1=1 2=1.117711e+00
267
  BinaryOp pow_110 1 1 373 374 0=6 1=1 2=-5.000000e-01
268
  BinaryOp mul_111 2 1 370 374 out0 0=2
269
  Concat cat_0 12 1 70 96 122 148 174 200 226 252 278 304 330 356 out3 0=0
bar/export-for-ncnn-lstm.sh ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+
3
+ # Please go to
4
+ # https://huggingface.co/csukuangfj/icefall-asr-librispeech-lstm-transducer-stateless2-2022-09-03
5
+ # to download the pre-trained models
6
+
7
+ if [ ! -d lstm2 ]; then
8
+ mkdir lstm2
9
+ pushd lstm2
10
+ ln -s ~/open-source/icefall-models/icefall-asr-librispeech-lstm-transducer-stateless2-2022-09-03/exp/pretrained-iter-468000-avg-16.pt epoch-99.pt
11
+ ln -s ~/open-source/icefall-models/icefall-asr-librispeech-lstm-transducer-stateless2-2022-09-03/data .
12
+ popd
13
+ fi
14
+
15
+ export CUDA_VISIBLE_DEVICES=""
16
+ set -ex
17
+
18
+ ./lstm_transducer_stateless2/export-for-ncnn.py \
19
+ --exp-dir ./lstm2 \
20
+ --bpe-model ./lstm2/data/lang_bpe_500/bpe.model \
21
+ --epoch 99 \
22
+ --avg 1 \
23
+ --use-averaged-model 0 \
24
+ --num-encoder-layers 12 \
25
+ --encoder-dim 512 \
26
+ --rnn-hidden-size 1024
27
+
28
+ cd ./lstm2
29
+
30
+ pnnx encoder_jit_trace-pnnx.pt
31
+ pnnx decoder_jit_trace-pnnx.pt
32
+ pnnx joiner_jit_trace-pnnx.pt
33
+
34
+ # Now we need to modified encoder_jit_trace-pnnx.ncnn.param for sherpa-ncnn
35
+ # The following is the diff
36
+ #
37
+ # diff -uN ./encoder_jit_trace-pnnx.ncnn.param-before ./encoder_jit_trace-pnnx.ncnn.param
38
+ # --- ./encoder_jit_trace-pnnx.ncnn.param-before 2023-02-15 11:27:14.000000000 +0800
39
+ # +++ ./encoder_jit_trace-pnnx.ncnn.param 2023-02-15 11:35:41.000000000 +0800
40
+ # @@ -1,5 +1,6 @@
41
+ # 7767517
42
+ # -267 379
43
+ # +268 379
44
+ # +SherpaMetaData sherpa_meta_data1 0 0 0=3 1=12 2=512 3=1024
45
+ # Input in0 0 1 in0
46
+ # Input in1 0 1 in1
47
+ # Input in2 0 1 in2
48
+
49
+ #
50
+ #
51
+ # Explanation:
52
+ # 1. A new layer is added, so we change the layer number 267 to 268
53
+ # 2. SherpaMetaData, it is the layer type. MUST be SherpaMetaData
54
+ # 3. sherpa_meta_data1, it is the layer name. MUST be sherpa_meta_data1
55
+ # 4. 0=3, attribute 0, MUST be 3
56
+ # 5. 1=12, attribute 1, 12 is the value of --num-encoder-layers
57
+ # 6. 2=512, attribute 2, 512 is the value of --encoder-dim
58
+ # 7. 3=1024, attribute 3, 1024 is the value of --rnn-hidden-size
bar/joiner_jit_trace-v2-iter-468000-avg-16-pnnx.ncnn.bin CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:a9e96223c3c1f60d39fca5264a418e561d53a684fc5694c14999b1c29a235ae7
3
  size 1566684
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:50a8e255319475d80ac5c0aefd7c91ae557c844700168e536d9af1798f71f67d
3
  size 1566684