Bhili ASR - ONNX

The ONNX version of the Automatic Speech Recognition (ASR) model for Bhili (ΰ€­ΰ₯€ΰ€²ΰ₯€), specifically the Dehvali Bhili dialect, an Indo-Aryan language spoken by the Bhil community in western India. The NeMo version of the model can be found here. Try out the model here!

Installation

pip install transformers torch torchaudio onnxruntime huggingface_hub

Usage

Basic Inference

from transformers import AutoModel
import torchaudio

model = AutoModel.from_pretrained(
    "ai4bharat/bhili-asr-onnx",
    trust_remote_code=True
)

wav, sr = torchaudio.load("audio.wav")

if sr != 16000:
    wav = torchaudio.transforms.Resample(sr, 16000)(wav)

if wav.shape[0] > 1:
    wav = wav.mean(dim=0, keepdim=True)

text = model(wav, "mr", "ctc")
print(text)

GPU Inference

import torch
from transformers import AutoModel

print(f"Using: {'CUDA' if torch.cuda.is_available() else 'CPU'}")

model = AutoModel.from_pretrained(
    "ai4bharat/bhili-asr-onnx",
    trust_remote_code=True
)

text = model(wav, "mr", "ctc")

⚠️ Note on Tokenizer Choice

Bhili does not currently have a dedicated tokenizer in the IndicConformer model’s supported language set. We use the Marathi (mr) tokenizer as the closest alternative, since both languages use the Devanagari script.

Model Components

bhili-asr-onnx/
β”œβ”€β”€ config.json
β”œβ”€β”€ model_onnx.py              # HuggingFace inference wrapper
β”œβ”€β”€ README.md
└── assets/
    β”œβ”€β”€ preprocessor.ts        # Audio preprocessing (TorchScript)
    β”œβ”€β”€ encoder.onnx           # Conformer encoder (fine-tuned)
    β”œβ”€β”€ ctc_decoder.onnx       # CTC projection layer
    β”œβ”€β”€ rnnt_decoder.onnx      # RNN-T prediction network
    β”œβ”€β”€ joint_enc.onnx         # Joint network encoder projection
    β”œβ”€β”€ joint_pred.onnx        # Joint network prediction projection
    β”œβ”€β”€ joint_pre_net.onnx     # Joint pre-network
    β”œβ”€β”€ joint_post_net_*.onnx  # Language-specific post networks
    β”œβ”€β”€ vocab.json             # Tokenizer vocabulary
    └── language_masks.json    # Per-language vocabulary masks
Downloads last month
28
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for ai4bharat/bhili-asr-onnx

Quantized
(9)
this model

Collection including ai4bharat/bhili-asr-onnx