Views
No views yet
label_list = [
"assamese",
"bengali",
"bodo",
"dogri",
"english",
"gujarati",
"hindi",
"kannada",
"kashmiri",
"konkani",
"maithili",
"malayalam",
"manipuri",
"marathi",
"nepali",
"odia",
"punjabi",
"sanskrit",
"santali",
"sindhi",
"tamil",
"telugu",
"urdu"
]git clone git@github.com:tiantiaf0627/voxlect1conda create -n voxlect python=3.8
2cd voxlect
3pip install -e .1# Load libraries
2import torch
3import torch.nn.functional as F
4from src.model.dialect.mms_dialect import MMSWrapper
5
6# Find device
7device = torch.device("cuda") if torch.cuda.is_available() else "cpu"
8
9# Load model from Huggingface
10model = MMSWrapper.from_pretrained("tiantiaf/voxlect-indic-lid-mms-lid-256").to(device)
11model.eval()1# Label List
2label_list = [
3 "assamese",
4 "bengali",
5 "bodo",
6 "dogri",
7 "english",
8 "gujarati",
9 "hindi",
10 "kannada",
11 "kashmiri",
12 "konkani",
13 "maithili",
14 "malayalam",
15 "manipuri",
16 "marathi",
17 "nepali",
18 "odia",
19 "punjabi",
20 "sanskrit",
21 "santali",
22 "sindhi",
23 "tamil",
24 "telugu",
25 "urdu"
26]
27
28# Load data, here just zeros as the example
29# Our training data filters output audio shorter than 3 seconds (unreliable predictions) and longer than 15 seconds (computation limitation)
30# So you need to prepare your audio to a maximum of 15 seconds, 16kHz and mono channel
31max_audio_length = 15 * 16000
32data = torch.zeros([1, 16000]).float().to(device)[:, :max_audio_length]
33logits, embeddings = model(data, return_feature=True)
34
35# Probability and output
36dialect_prob = F.softmax(logits, dim=1)
37print(dialect_list[torch.argmax(dialect_prob).detach().cpu().item()])@article{feng2025voxlect,
title={Voxlect: A Speech Foundation Model Benchmark for Modeling Dialects and Regional Languages Around the Globe},
author={Feng, Tiantian and Huang, Kevin and Xu, Anfeng and Shi, Xuan and Lertpetchpun, Thanathai and Lee, Jihwan and Lee, Yoonjeong and Byrd, Dani and Narayanan, Shrikanth},
journal={arXiv preprint arXiv:2508.01691},
year={2025}
}