--- license: cc-by-4.0 language: - ru base_model: - nvidia/stt_ru_fastconformer_hybrid_large_pc pipeline_tag: automatic-speech-recognition tags: - automatic-speech-recognition - asr - onnx - onnx-asr --- NVIDIA FastConformer-Hybrid Large (ru) [model](https://huggingface.co/nvidia/stt_ru_fastconformer_hybrid_large_pc) converted to ONNX format for [onnx-asr](https://github.com/istupakov/onnx-asr). Install onnx-asr ```shell pip install onnx-asr[cpu,hub] ``` Load FastConformer Ru model with CTC decoder and recognize wav file ```py import onnx_asr model = onnx_asr.load_model("nemo-fastconformer-ru-ctc") print(model.recognize("test.wav")) ``` Load FastConformer Ru model with RNN-T decoder and recognize wav file ```py import onnx_asr model = onnx_asr.load_model("nemo-fastconformer-ru-rnnt") print(model.recognize("test.wav")) ``` Code for models export ```py import nemo.collections.asr as nemo_asr from pathlib import Path model_name = "stt_ru_fastconformer_hybrid_large_pc" onnx_dir = Path("nemo-onnx") onnx_dir.mkdir(exist_ok=True) model = nemo_asr.models.ASRModel.from_pretrained("nvidia/" + model_name) # For export Hybrid models with CTC decoder # model.set_export_config({"decoder_type": "ctc"}) model.export(str(Path(onnx_dir, "model.onnx"))) with Path(onnx_dir, "vocab.txt").open("wt") as f: for i, token in enumerate([*model.tokenizer.vocab, ""]): f.write(f"{token} {i}\n") ```