Views
No views yet
bfloat16 safetensors shard of approximately 4.84 GB.bfloat16 safetensorsnum_beams=1,
max_new_tokens=512), a single dataset-agnostic chat template, and scored with
the leaderboard's standardized scoring (English normalizer + word-level edit
distance with compound merging). TED-LIUM is not currently part of the
leaderboard run and is therefore excluded.| Dataset | WER (%) |
|---|---|
| AMI | 8.37 |
| Earnings22 | 7.84 |
| GigaSpeech | 6.78 |
| LibriSpeech test.clean | 1.21 |
| LibriSpeech test.other | 2.84 |
| SPGISpeech | 1.63 |
| VoxPopuli | 5.39 |
| Average | 4.87 |
1import librosa
2import torch
3from huggingface_hub import hf_hub_download
4from transformers import AutoModelForCausalLM, AutoTokenizer
5from transformers.dynamic_module_utils import get_class_from_dynamic_module
6
7REPO = "OpenMOSS-Team/MOSS-Transcribe-preview-2B"
8DEVICE = "cuda:0"
9
10model = AutoModelForCausalLM.from_pretrained(
11 REPO, dtype=torch.bfloat16, trust_remote_code=True
12).to(DEVICE).eval()
13tokenizer = AutoTokenizer.from_pretrained(REPO, trust_remote_code=True)
14
15MossProcessor = get_class_from_dynamic_module("processing_Moss.MossProcessor", REPO)
16MelConfig = get_class_from_dynamic_module("processing_Moss.MelConfig", REPO)
17
18mel_cfg = MelConfig(
19 mel_sr=16000,
20 mel_dim=128,
21 mel_n_fft=400,
22 mel_hop_length=160,
23)
24processor = MossProcessor(tokenizer, config=mel_cfg, enable_time_marker=False)
25processor.load_template(hf_hub_download(REPO, "chat_template_default.py"))
26
27waveform, _ = librosa.load("your_audio.wav", sr=16000)
28inputs = processor(audio=waveform, return_tensors="pt").to(DEVICE)
29inputs["audio_data"] = inputs["audio_data"].to(model.dtype)
30
31with torch.no_grad():
32 out_ids = model.generate(
33 **inputs,
34 max_new_tokens=512,
35 do_sample=False,
36 num_beams=1,
37 use_cache=True,
38 eos_token_id=[processor.end_token_id],
39 )
40
41new_ids = out_ids[:, inputs["input_ids"].shape[1]:]
42transcript = processor.batch_decode(new_ids, skip_special_tokens=True)[0].strip()
43print(transcript)1@misc{moss_transcribe_2025,
2 title = {{MOSS-Transcribe-preview-2B}},
3 author = {{OpenMOSS Team}},
4 year = {2025},
5 howpublished = {\url{https://huggingface.co/OpenMOSS-Team/MOSS-Transcribe-preview-2B}}
6}