Views
No views yet
pip install onnx-asr[cpu,hub]1import onnx_asr
2model = onnx_asr.load_model("nemo-fastconformer-ru-ctc")
3print(model.recognize("test.wav"))1import onnx_asr
2model = onnx_asr.load_model("nemo-fastconformer-ru-rnnt")
3print(model.recognize("test.wav"))1import nemo.collections.asr as nemo_asr
2from pathlib import Path
3
4model_name = "stt_ru_fastconformer_hybrid_large_pc"
5onnx_dir = Path("nemo-onnx")
6onnx_dir.mkdir(exist_ok=True)
7
8model = nemo_asr.models.ASRModel.from_pretrained("nvidia/" + model_name)
9
10# For export Hybrid models with CTC decoder
11# model.set_export_config({"decoder_type": "ctc"})
12
13model.export(str(Path(onnx_dir, "model.onnx")))
14
15with Path(onnx_dir, "vocab.txt").open("wt") as f:
16 for i, token in enumerate([*model.tokenizer.vocab, "<blk>"]):
17 f.write(f"{token} {i}\n")