Views
No views yet
[
'East Asia',
'English',
'Germanic',
'Irish',
'North America',
'Northern Irish',
'Oceania',
'Other',
'Romance',
'Scottish',
'Semitic',
'Slavic',
'South African',
'Southeast Asia',
'South Asia',
'Welsh'
]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-english-dialect-mms-lid-256").to(device)
11model.eval()1# Label List
2dialect_list = [
3 'East Asia',
4 'English',
5 'Germanic',
6 'Irish',
7 'North America',
8 'Northern Irish',
9 'Oceania',
10 'Other',
11 'Romance',
12 'Scottish',
13 'Semitic',
14 'Slavic',
15 'South African',
16 'Southeast Asia',
17 'South Asia',
18 'Welsh'
19]
20
21# Load data, here just zeros as the example
22# Our training data filters output audio shorter than 3 seconds (unreliable predictions) and longer than 15 seconds (computation limitation)
23# So you need to prepare your audio to a maximum of 15 seconds, 16kHz and mono channel
24max_audio_length = 15 * 16000
25data = torch.zeros([1, 16000]).float().to(device)[:, :max_audio_length]
26logits, embeddings = model(data, return_feature=True)
27
28# Probability and output
29dialect_prob = F.softmax(logits, dim=1)
30print(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}
}