marcoyang/SALMONN-2-8B

Model

SALMONN-2 8B

3

5 commits

2 linked in READMEs

updated Jul 23, 2026

See the code

README

SALMONN-2 8B

SALMONN-2 is an open-source audio large language model (ALLM) for speech, general audio, music, and paralinguistic understanding. It combines the SPEAR audio encoder, a multi-layer feature-fusion adapter, and Qwen3-8B.

This checkpoint contains the merged Qwen LoRA weights, SPEAR audio encoder, audio connector, tokenizer assets, and custom Hugging Face model code. Load it with trust_remote_code=True.

For command-line and batch inference, multi-audio and multimodal in-context learning examples, environment details, and fine-tuning instructions, see the SALMONN-2 GitHub repository.

Results

SALMONN-2 achieves strong performance on three audio-language model (ALLM) benchmarks while using 18.2k hours of supervised audio-text training data. The table below shows the 8B model comparison.

ModelSupervised audio-text data (h)MMAU-ProMMARMMSU
Qwen2.5-Omni--52.256.761.3
Kimi-Audio>13M56.660.854.7
MiMo-Audio>1M53.461.761.9
AF-3>55k51.758.561.4
MOSS-Audio>1M57.564.466.4
SALMONN-2 8B18.2k58.564.569.5

Minimal Hugging Face inference

The following example loads this repository directly with Hugging Face transformers; cloning or installing the SALMONN-2 GitHub package is not required.

pip install "transformers>=4.57,<5" accelerate torch torchaudio
import torch
from transformers import AutoModelForCausalLM, AutoProcessor

model_id = "marcoyang/salmonn-2-8b-test"

processor = AutoProcessor.from_pretrained(
    model_id,
    trust_remote_code=True,
    fix_mistral_regex=False,
)
model = AutoModelForCausalLM.from_pretrained(
    model_id,
    trust_remote_code=True,
    dtype=torch.bfloat16,
    device_map="auto",
).eval()
processor.prepare_model(model)

inputs = processor(
    audios=["example.wav"],
    instruction="Please describe the audio.",
)
device = next(model.parameters()).device

with torch.inference_mode():
    output_ids = model.generate(
        **inputs.to(device),
        max_new_tokens=256,
        do_sample=False,
    )

print(processor.decode(output_ids[0]))

The processor loads and resamples audio, computes the SPEAR filterbank input, formats the chat prompt, and returns all model inputs. The example uses bfloat16 and automatic device placement. A CUDA GPU is recommended for practical inference.

Contextual ASR

For text-only contextual words, pass a list of strings:

inputs = processor(
    audios=["main_utterance.wav"],
    instruction="Recognize the speech and give me the transcription.",
    context=["howes", "wszelaki"],
)

To provide both the spelling and pronunciation of each contextual word, pair the text with a context audio file:

inputs = processor(
    audios=["main_utterance.wav"],
    instruction="Recognize the speech and give me the transcription.",
    context=[
        {"text": "howes", "audio": "howes.wav"},
        {"text": "wszelaki", "audio": "wszelaki.wav"},
    ],
)

The processor places all model-specific audio markers and contextual formatting automatically.

Advanced prompt placement

For custom multi-audio layouts, use formatted_prompt with one <audio> marker per input file. Audio files are matched to the markers from left to right:

inputs = processor(
    audios=["main.wav", "example.wav"],
    formatted_prompt=(
        "<audio>Compare the main recording with this example: "
        "<audio>What do they have in common?"
    ),
)

The processor still loads the audio, computes filterbanks, validates marker alignment, applies the chat template, and returns model-ready tensors.

License

Apache License 2.0. See LICENSE.

Citation

@inproceedings{yang2026spear,
  title     = {SPEAR: A Unified SSL Framework for Learning Speech and Audio Representations},
  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.},
  booktitle = {Proceedings of the Forty-third International Conference on Machine Learning},
  year      = {2026}
}
audio
audio-language-model
audio-understanding
custom_code
feature-extraction
music
safetensors
salmonn_2
speech
transformers

Contributors

marcoyang

5 commits

marcoyang/SALMONN-2-8B

Model

SALMONN-2 8B

3

5 commits

2 linked in READMEs

updated Jul 23, 2026

See the code

README

SALMONN-2 8B

SALMONN-2 is an open-source audio large language model (ALLM) for speech, general audio, music, and paralinguistic understanding. It combines the SPEAR audio encoder, a multi-layer feature-fusion adapter, and Qwen3-8B.

This checkpoint contains the merged Qwen LoRA weights, SPEAR audio encoder, audio connector, tokenizer assets, and custom Hugging Face model code. Load it with trust_remote_code=True.

For command-line and batch inference, multi-audio and multimodal in-context learning examples, environment details, and fine-tuning instructions, see the SALMONN-2 GitHub repository.

Results

SALMONN-2 achieves strong performance on three audio-language model (ALLM) benchmarks while using 18.2k hours of supervised audio-text training data. The table below shows the 8B model comparison.

ModelSupervised audio-text data (h)MMAU-ProMMARMMSU
Qwen2.5-Omni--52.256.761.3
Kimi-Audio>13M56.660.854.7
MiMo-Audio>1M53.461.761.9
AF-3>55k51.758.561.4
MOSS-Audio>1M57.564.466.4
SALMONN-2 8B18.2k58.564.569.5

Minimal Hugging Face inference

The following example loads this repository directly with Hugging Face transformers; cloning or installing the SALMONN-2 GitHub package is not required.

pip install "transformers>=4.57,<5" accelerate torch torchaudio
import torch
from transformers import AutoModelForCausalLM, AutoProcessor

model_id = "marcoyang/salmonn-2-8b-test"

processor = AutoProcessor.from_pretrained(
    model_id,
    trust_remote_code=True,
    fix_mistral_regex=False,
)
model = AutoModelForCausalLM.from_pretrained(
    model_id,
    trust_remote_code=True,
    dtype=torch.bfloat16,
    device_map="auto",
).eval()
processor.prepare_model(model)

inputs = processor(
    audios=["example.wav"],
    instruction="Please describe the audio.",
)
device = next(model.parameters()).device

with torch.inference_mode():
    output_ids = model.generate(
        **inputs.to(device),
        max_new_tokens=256,
        do_sample=False,
    )

print(processor.decode(output_ids[0]))

The processor loads and resamples audio, computes the SPEAR filterbank input, formats the chat prompt, and returns all model inputs. The example uses bfloat16 and automatic device placement. A CUDA GPU is recommended for practical inference.

Contextual ASR

For text-only contextual words, pass a list of strings:

inputs = processor(
    audios=["main_utterance.wav"],
    instruction="Recognize the speech and give me the transcription.",
    context=["howes", "wszelaki"],
)

To provide both the spelling and pronunciation of each contextual word, pair the text with a context audio file:

inputs = processor(
    audios=["main_utterance.wav"],
    instruction="Recognize the speech and give me the transcription.",
    context=[
        {"text": "howes", "audio": "howes.wav"},
        {"text": "wszelaki", "audio": "wszelaki.wav"},
    ],
)

The processor places all model-specific audio markers and contextual formatting automatically.

Advanced prompt placement

For custom multi-audio layouts, use formatted_prompt with one <audio> marker per input file. Audio files are matched to the markers from left to right:

inputs = processor(
    audios=["main.wav", "example.wav"],
    formatted_prompt=(
        "<audio>Compare the main recording with this example: "
        "<audio>What do they have in common?"
    ),
)

The processor still loads the audio, computes filterbanks, validates marker alignment, applies the chat template, and returns model-ready tensors.

License

Apache License 2.0. See LICENSE.

Citation

@inproceedings{yang2026spear,
  title     = {SPEAR: A Unified SSL Framework for Learning Speech and Audio Representations},
  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.},
  booktitle = {Proceedings of the Forty-third International Conference on Machine Learning},
  year      = {2026}
}
audio
audio-language-model
audio-understanding
custom_code
feature-extraction
music
safetensors
salmonn_2
speech
transformers

Contributors

marcoyang

5 commits