Views
No views yet
facebook/seamless-m4t-v2-large for Speech-to-Text Translation (S2TT) from Bahnar to Vietnamese.facebook/seamless-m4t-v2-largebdq)vie)Note This model only supports the Speech-to-Text Translation (S2TT) task.
1import torch
2import soundfile as sf
3from transformers import AutoProcessor, SeamlessM4Tv2ForSpeechToText
4
5model_id = "cuong06/seamlessm4t-v2-Bahnar-Vietnamese"
6
7processor = AutoProcessor.from_pretrained(model_id)
8model = SeamlessM4Tv2ForSpeechToText.from_pretrained(model_id)
9
10audio, sampling_rate = sf.read("sample.wav")
11
12inputs = processor(
13 audio=audio,
14 sampling_rate=sampling_rate,
15 return_tensors="pt"
16)
17
18with torch.no_grad():
19 predicted_ids = model.generate(
20 **inputs,
21 tgt_lang="vie"
22 )
23
24translation = processor.batch_decode(
25 predicted_ids,
26 skip_special_tokens=True
27)[0]
28
29print(translation)beam_size=5):| Metric | Score |
|---|---|
| BLEU | 24.58 |
nrefs:1|case:lc|eff:no|tok:13a|smooth:exp|version:2.6.1@misc{bahnar_vietnamese_s2tt,
2 author = {Dam Cuong},
3 title = {Bahnar-Vietnamese Speech-to-Text Translation},
4 year = {2026},
5 howpublished = {\url{https://github.com/damcuong8/Bahnar-Vietnamese-S2TT}}
6}