Views
No views yet
trust_remote_code=True.| Model | Supervised audio-text data (h) | MMAU-Pro | MMAR | MMSU |
|---|---|---|---|---|
| Qwen2.5-Omni | -- | 52.2 | 56.7 | 61.3 |
| Kimi-Audio | >13M | 56.6 | 60.8 | 54.7 |
| MiMo-Audio | >1M | 53.4 | 61.7 | 61.9 |
| AF-3 | >55k | 51.7 | 58.5 | 61.4 |
| MOSS-Audio | >1M | 57.5 | 64.4 | 66.4 |
| SALMONN-2 8B | 18.2k | 58.5 | 64.5 | 69.5 |
transformers; cloning or
installing the SALMONN-2 GitHub package is not required.pip install "transformers>=4.57,<5" accelerate torch torchaudio1import torch
2from transformers import AutoModelForCausalLM, AutoProcessor
3
4model_id = "marcoyang/salmonn-2-8b-test"
5
6processor = AutoProcessor.from_pretrained(
7 model_id,
8 trust_remote_code=True,
9 fix_mistral_regex=False,
10)
11model = AutoModelForCausalLM.from_pretrained(
12 model_id,
13 trust_remote_code=True,
14 dtype=torch.bfloat16,
15 device_map="auto",
16).eval()
17processor.prepare_model(model)
18
19inputs = processor(
20 audios=["example.wav"],
21 instruction="Please describe the audio.",
22)
23device = next(model.parameters()).device
24
25with torch.inference_mode():
26 output_ids = model.generate(
27 **inputs.to(device),
28 max_new_tokens=256,
29 do_sample=False,
30 )
31
32print(processor.decode(output_ids[0]))1inputs = processor(
2 audios=["main_utterance.wav"],
3 instruction="Recognize the speech and give me the transcription.",
4 context=["howes", "wszelaki"],
5)1inputs = processor(
2 audios=["main_utterance.wav"],
3 instruction="Recognize the speech and give me the transcription.",
4 context=[
5 {"text": "howes", "audio": "howes.wav"},
6 {"text": "wszelaki", "audio": "wszelaki.wav"},
7 ],
8)formatted_prompt with one <audio> marker per input file.
Audio files are matched to the markers from left to right:1inputs = processor(
2 audios=["main.wav", "example.wav"],
3 formatted_prompt=(
4 "<audio>Compare the main recording with this example: "
5 "<audio>What do they have in common?"
6 ),
7)1@inproceedings{yang2026spear,
2 title = {SPEAR: A Unified SSL Framework for Learning Speech and Audio Representations},
3 author = {Yang, Xubo and Yang, Yuxuan and Jin, Ziyang and Cui, Zeyu and Wu, Wen and Li, Bo and Zhang, Chao and Woodland, Philip C.},
4 booktitle = {Proceedings of the Forty-third International Conference on Machine Learning},
5 year = {2026}
6}