43 Commits

Author SHA1 Message Date
Fangjun Kuang
e22bc78f98
Export streaming zipformer2 to RKNN (#1977) 2025-07-11 13:24:01 +08:00
Fangjun Kuang
fba5e67d5e
Fix CI tests. (#1974)
- Introduce unified AMP helpers (create_grad_scaler, torch_autocast) to handle 
  deprecations in PyTorch ≥2.3.0

- Replace direct uses of torch.cuda.amp.GradScaler and torch.cuda.amp.autocast 
  with the new utilities across all training and inference scripts

- Update all torch.load calls to include weights_only=False for compatibility with 
  newer PyTorch versions
2025-07-01 13:47:55 +08:00
Fangjun Kuang
db9fb8ad31
Add scripts to export streaming zipformer(v1) to RKNN (#1882) 2025-02-27 17:10:58 +08:00
Fangjun Kuang
d4d4f281ec
Revert "Replace deprecated pytorch methods (#1814)" (#1841)
This reverts commit 3e4da5f78160d3dba3bdf97968bd7ceb8c11631f.
2024-12-18 16:49:57 +08:00
Li Peng
3e4da5f781
Replace deprecated pytorch methods (#1814)
* Replace deprecated pytorch methods

- torch.cuda.amp.GradScaler(...) => torch.amp.GradScaler("cuda", ...)
- torch.cuda.amp.autocast(...) => torch.amp.autocast("cuda", ...)

* Replace `with autocast(...)` with `with autocast("cuda", ...)`


Co-authored-by: Li Peng <lipeng@unisound.ai>
2024-12-16 10:24:16 +08:00
zr_jin
eb132da00d
additional instruction for the grad_scale is too small error (#1550) 2024-03-14 11:33:49 +08:00
zr_jin
242002e0bd
Strengthened style constraints (#1527) 2024-03-04 23:28:04 +08:00
Fangjun Kuang
8d39f9508b
Fix torchscript export to use tokens.txt instead of lang_dir (#1475) 2024-01-26 19:18:33 +08:00
zr_jin
5445ea6df6
Use shuffled LibriSpeech cuts instead (#1450)
* use shuffled LibriSpeech cuts instead

* leave the old code in comments for reference
2024-01-08 15:09:21 +08:00
Karel Vesely
716b82cc3a
streaming_decode.py, relax the audio range from [-1,+1] to [-10,+10] (#1448)
- some AudioTransform classes produce audio signals out of range [-1,+1]
   - Resample produced 1.0079
   - The range [-10,+10] was chosen to still be able to reliably
     distinguish from the [-32k,+32k] signal...
- this is related to : https://github.com/lhotse-speech/lhotse/issues/1254
2024-01-05 10:21:27 +08:00
Fangjun Kuang
8136ad775b
Use high_freq -400 in computing fbank features. (#1447)
See also https://github.com/k2-fsa/sherpa-onnx/issues/514
2024-01-04 13:59:32 +08:00
Fangjun Kuang
e9ec827de7
Rename zipformer2 to zipformer_for_ncnn_export_only to avoid confusion. (#1407) 2023-12-08 14:29:24 +08:00
LoganLiu66
f08af2fa22
fix initial states (#1398)
Co-authored-by: liujiawang02 <liujiawang02@baidu.com>
2023-12-04 22:29:42 +08:00
Fangjun Kuang
666d69b20d
Rename train2.py to avoid confusion (#1386) 2023-11-17 18:12:59 +08:00
zr_jin
ef658d691e
fixes for init value of diagnostics.TensorDiagnosticOptions (#1269)
* fixes for `diagnostics`

Replace `2 ** 22` with `512` as the default value of `diagnostics.TensorDiagnosticOptions`

also black formatted some scripts

* fixed formatting issues
2023-09-24 17:06:47 +08:00
Fangjun Kuang
34e40a86b3
Fix exporting decoder model to onnx (#1264)
* Use torch.jit.script() to export the decoder model

See also https://github.com/k2-fsa/sherpa-onnx/issues/327
2023-09-22 09:57:15 +08:00
Fangjun Kuang
f5dc957d44
Fix CI tests (#1266) 2023-09-21 21:16:14 +08:00
l2009312042
45d60ef262
Update conformer.py (#1200)
* Update conformer.py
* Update zipformer.py

fix bug in get_dynamic_dropout_rate
2023-09-21 19:41:10 +08:00
zr_jin
a81396b482
Use tokens.txt to replace bpe.model (#1162) 2023-08-12 16:53:59 +08:00
marcoyang1998
1ee251c8b3
Decode zipformer with external LMs (#1193)
* update some documentation

* support decoding with LMs in zipformer recipe

* update RESULTS.md
2023-08-03 15:50:35 +08:00
Fangjun Kuang
b8a17944e4
Fix zipformer CI test (#1164) 2023-07-05 10:23:35 +08:00
frankyoujian
4d5b8369ae
fix small typo (#1144) 2023-06-21 17:17:19 +08:00
Yifan Yang
ca60ced213
Fix typo (#1114)
* Fix typo for zipformer

* Fix typo for pruned_transducer_stateless7

* Fix typo for pruned_transducer_stateless7_ctc

* Fix typo for pruned_transducer_stateless7_ctc_bs

* Fix typo for pruned_transducer_stateless7_streaming

* Fix typo for pruned_transducer_stateless7_streaming_multi

* Fix file permissions for pruned_transducer_stateless7_streaming_multi

* Fix typo for pruned_transducer_stateless8

* Fix typo for pruned_transducer_stateless6

* Fix typo for pruned_transducer_stateless5

* Fix typo for pruned_transducer_stateless4

* Fix typo for pruned_transducer_stateless3
2023-06-02 14:12:42 +08:00
Fangjun Kuang
7b0afbdc16
Remove cur_batch_idx (#1102) 2023-05-30 14:49:54 +08:00
Fangjun Kuang
ae1949ddcc
Support using the latest master from tencent/ncnn (#1070)
* Support using the latest master from tencent/ncnn

* small fixes
2023-05-18 20:56:58 +08:00
Fangjun Kuang
5b50ffda54
support using mini librispeech in training (#1048)
* support mini librispeech in training

* update onnx export doc
2023-05-09 15:10:06 +08:00
marcoyang1998
45c13e90e4
RNNLM rescore + Low-order density ratio (#1017)
* add rnnlm rescore + LODR

* add LODR in decode.py

* update RESULTS
2023-04-24 15:00:02 +08:00
marcoyang1998
57d6482a79
Streaming Zipformer with multi-dataset (#984)
* modify train.py

* add right padding option in decode.py

* update RESULTS.md
2023-04-21 15:43:28 +08:00
marcoyang1998
34d1b07c3d
Modified beam search with RNNLM rescoring (#1002)
* add RNNLM rescore

* add shallow fusion and lm rescore for streaming zipformer

* minor fix

* update RESULTS.md

* fix yesno workflow, change from ubuntu-18.04 to ubuntu-latest
2023-04-17 16:43:00 +08:00
Fangjun Kuang
e32658e620
Fix torch.jit.script() export for streaming zipformer. (#1005) 2023-04-17 16:13:30 +08:00
Zengwei Yao
7c7d9ab042
add @torch.jit.export for streaming_forward func in Zipformer class (#1004) 2023-04-17 12:03:52 +08:00
Fangjun Kuang
a632b24c35
Export int8 quantized models for non-streaming Zipformer. (#977)
* Export int8 quantized models for non-streaming Zipformer.

* Delete export-onnx.py

* Export int8 models for other folders
2023-03-31 22:46:19 +08:00
Fangjun Kuang
f5de2e90c6
Fix style issues. (#937) 2023-03-08 22:56:04 +08:00
pehonnet
07243d136a
remove key from result filename (#936)
Co-authored-by: pe-honnet <pe.honnet@telepathy.ai>
2023-03-08 21:06:07 +08:00
Fangjun Kuang
c5e687ddf5
Export streaming zipformer to ncnn (#906) 2023-02-13 23:41:43 +08:00
Fangjun Kuang
2b995639b7
Add ONNX support for Zipformer and ConvEmformer (#884) 2023-02-09 00:02:38 +08:00
Fangjun Kuang
8d3810e289
Simplify ONNX export (#881)
* Simplify ONNX export

* Fix ONNX CI tests
2023-02-07 15:01:59 +08:00
Fangjun Kuang
52f3a747be
Refactor onnx export for streaming zipformer (#879) 2023-02-07 12:12:26 +08:00
Yuekai Zhang
bf5f0342a2
Add streaming onnx export for zipformer (#831)
* add streaming onnx export for zipformer

* update triton support

* add comments

* add ci test

* add onnxmltools for fp16 onnx export
2023-02-06 10:37:07 +08:00
Zengwei Yao
1e6d6f8160
shuffle full Librispeech for zipformer recipes (#869)
* shuffle libri
2023-02-03 11:54:57 +08:00
Teo Wen Shen
1ce2bc1ee0
edit comments (#852) 2023-01-28 13:47:21 +08:00
Zengwei Yao
67ae5fdf2b
Doc streaming zipformer (#798)
* add doc for streaming_zipformer

* update README.md
2022-12-30 15:21:18 +08:00
Zengwei Yao
d167aad4ab
Add streaming zipformer (#787)
* add streaming zipformer codes

* add test_model.py

* add export.py, pretrained.py, jit_pretrained.py

* add cached_len for pooling module

* add jit_trace_export.py and jit_trace_pretrained.py

* fix bug in jit.trace

* update RESULTS.md

* add CI test

* minor fix in pruned_transducer_stateless7/zipformer.py

* update README.md
2022-12-30 10:52:18 +08:00