OpenMOSS-Team / MOSS-Audio-Tokenizer-v2

huggingface.co
Total runs: 22.3K
24-hour runs: 0
7-day runs: -4.1K
30-day runs: -4.1K
Model's Last Updated: June 11 2026
feature-extraction

Introduction of MOSS-Audio-Tokenizer-v2

Model Details of MOSS-Audio-Tokenizer-v2

MOSS-Audio-Tokenizer-v2

This is the code for the 48khz stereo version of MOSS-Audio-Tokenizer presented in MOSS-Audio-Tokenizer: Scaling Audio Tokenizers for Future Audio Foundation Models .

MOSS-Audio-Tokenizer-v2 is a unified discrete audio tokenizer based on the Cat ( C ausal A udio T okenizer with T ransformer) architecture. Scaling to 2 billion parameters, it functions as a unified discrete interface, delivering both lossless-quality reconstruction and high-level semantic alignment.

Key Features:

  • Extreme Compression & Variable Bitrate : It compresses 48kHz stereo audio into a remarkably low frame rate of 12.5Hz. Utilizing a 32-layer Residual Vector Quantization stack, it supports high-fidelity reconstruction across a wide range of bitrates.
  • Pure Transformer Architecture : The model features a "CNN-free" homogeneous architecture built entirely from Causal Transformer blocks. With 2B combined parameters (Encoder + Decoder), it ensures exceptional scalability and supports low-latency streaming inference.
  • Large-Scale General Audio Training : Trained on 3 million hours of diverse audio data, the model excels at encoding and reconstructing all audio domains, including speech, sound effects, and music.
  • Unified Semantic-Acoustic Representation : While achieving state-of-the-art reconstruction quality, Cat produces discrete tokens that are "semantic-rich," making them ideal for downstream tasks like speech understanding (ASR) and generation (TTS).
  • Fully Trained From Scratch : Cat does not rely on any pretrained encoders (such as HuBERT or Whisper) or distillation from teacher models. All representations are learned autonomously from raw data.
  • End-to-End Joint Optimization : All components—including the encoder, quantizer, decoder, discriminator, and a decoder-only LLM for semantic alignment—are optimized jointly in a single unified training pipeline.

Summary: By combining a simple, scalable architecture with massive-scale data, the Cat architecture overcomes the bottlenecks of traditional audio tokenizers. It provides a robust, high-fidelity, and semantically grounded interface for the next generation of native audio foundation models.

This repository contains a lightweight remote-code implementation that mirrors the current 🤗 Transformers transformers.models.moss_audio_tokenizer module. It is hosted as a Hugging Face Hub model repository and should be loaded with trust_remote_code=True .



Architecture of MossAudioTokenizer


Usage
Quickstart
import torch
from transformers import AutoModel
import torchaudio

repo_id = "OpenMOSS-Team/MOSS-Audio-Tokenizer-v2"
device = "cuda" if torch.cuda.is_available() else "cpu"
model = AutoModel.from_pretrained(repo_id, trust_remote_code=True).eval().to(device)

audio_path = "demo/demo_gt.wav"  # replace with your own 48 kHz stereo audio path if needed
wav, sr = torchaudio.load(audio_path)
if sr != model.sampling_rate:
    wav = torchaudio.functional.resample(wav, sr, model.sampling_rate)
if wav.shape[0] == 1:
    wav = wav.repeat(model.config.number_channels, 1)
else:
    wav = wav[: model.config.number_channels]
wav = wav.unsqueeze(0).to(device)
enc = model.encode(wav, return_dict=True)
print(f"enc.audio_codes.shape: {enc.audio_codes.shape}")
dec = model.decode(enc.audio_codes, return_dict=True)
print(f"dec.audio.shape: {dec.audio.shape}")
wav = dec.audio.squeeze(0)
torchaudio.save("demo/demo_rec.wav", wav.cpu(), sample_rate=model.sampling_rate)

# Decode using only the first 8 layers of the RVQ
dec_rvq8 = model.decode(enc.audio_codes[:8], return_dict=True)
wav_rvq8 = dec_rvq8.audio.squeeze(0)
torchaudio.save("demo/demo_rec_rvq8.wav", wav_rvq8.cpu(), sample_rate=model.sampling_rate)

For production use with trust_remote_code=True , pin revision to a reviewed commit hash.

Attention Backend And Compute Dtype

config.attention_implementation controls whether transformer layers prefer sdpa or flash_attention_2 . config.compute_dtype controls the non-quantizer autocast dtype and supports fp32 , bf16 .

model.set_attention_implementation("flash_attention_2")
model.set_compute_dtype("bf16")

The quantizer always runs in fp32.

Streaming

MossAudioTokenizerModel.encode , decode , batch_encode , and batch_decode all support streaming through a chunk_duration argument.

  • chunk_duration is expressed in seconds.
  • chunk_duration * MossAudioTokenizerConfig.sampling_rate must be divisible by MossAudioTokenizerConfig.downsample_rate .
  • Streaming batch inference is supported.
  • The public waveform interface expects stereo inputs shaped (2, T) or batched stereo inputs shaped (B, 2, T) .
import torch
from transformers import AutoModel

repo_id = "OpenMOSS-Team/MOSS-Audio-Tokenizer-v2"
device = "cuda" if torch.cuda.is_available() else "cpu"
model = AutoModel.from_pretrained(repo_id, trust_remote_code=True).eval().to(device)
audio = torch.randn(2, 48000 * 6).to(device)  # dummy stereo waveform

# 6.0s @ 48kHz = 288000 samples, divisible by downsample_rate=3840
enc = model.encode(audio.unsqueeze(0), return_dict=True, chunk_duration=0.08)
dec = model.decode(enc.audio_codes, return_dict=True, chunk_duration=0.08)

batch_enc = model.batch_encode([audio, audio[:, : 48000 * 3]], chunk_duration=0.08)
codes_list = [
    batch_enc.audio_codes[:, i, : batch_enc.audio_codes_lengths[i]]
    for i in range(batch_enc.audio_codes.shape[1])
]
batch_dec = model.batch_decode(codes_list, chunk_duration=0.08)
Repository layout
  • configuration_moss_audio_tokenizer.py
  • modeling_moss_audio_tokenizer.py
  • __init__.py
  • config.json
  • model.safetensors.index.json
  • sharded model weights: model-00001-of-00003.safetensors , model-00002-of-00003.safetensors , model-00003-of-00003.safetensors
  • demo/demo_gt.wav
Citation

If you use this code or result in your paper, please cite our work as:

@misc{gong2026mossaudiotokenizerscaling,
  title={MOSS-Audio-Tokenizer: Scaling Audio Tokenizers for Future Audio Foundation Models},
  author={Yitian Gong and Kuangwei Chen and Zhaoye Fei and Xiaogui Yang and Ke Chen and Yang Wang and Kexin Huang and Mingshu Chen and Ruixiao Li and Qingyuan Cheng and Shimin Li and Xipeng Qiu},
  year={2026},
  eprint={2602.10934},
  archivePrefix={arXiv},
  primaryClass={cs.SD},
  url={https://arxiv.org/abs/2602.10934}
}
License

MOSS-Audio-Tokenizer-v2 is released under the Apache 2.0 license. See LICENSE for the full license text.

Runs of OpenMOSS-Team MOSS-Audio-Tokenizer-v2 on huggingface.co

22.3K
Total runs
0
24-hour runs
-358
3-day runs
-4.1K
7-day runs
-4.1K
30-day runs

More Information About MOSS-Audio-Tokenizer-v2 huggingface.co Model

More MOSS-Audio-Tokenizer-v2 license Visit here:

https://choosealicense.com/licenses/apache-2.0

MOSS-Audio-Tokenizer-v2 huggingface.co

MOSS-Audio-Tokenizer-v2 huggingface.co is an AI model on huggingface.co that provides MOSS-Audio-Tokenizer-v2's model effect (), which can be used instantly with this OpenMOSS-Team MOSS-Audio-Tokenizer-v2 model. huggingface.co supports a free trial of the MOSS-Audio-Tokenizer-v2 model, and also provides paid use of the MOSS-Audio-Tokenizer-v2. Support call MOSS-Audio-Tokenizer-v2 model through api, including Node.js, Python, http.

MOSS-Audio-Tokenizer-v2 huggingface.co Url

https://huggingface.co/OpenMOSS-Team/MOSS-Audio-Tokenizer-v2

OpenMOSS-Team MOSS-Audio-Tokenizer-v2 online free

MOSS-Audio-Tokenizer-v2 huggingface.co is an online trial and call api platform, which integrates MOSS-Audio-Tokenizer-v2's modeling effects, including api services, and provides a free online trial of MOSS-Audio-Tokenizer-v2, you can try MOSS-Audio-Tokenizer-v2 online for free by clicking the link below.

OpenMOSS-Team MOSS-Audio-Tokenizer-v2 online free url in huggingface.co:

https://huggingface.co/OpenMOSS-Team/MOSS-Audio-Tokenizer-v2

MOSS-Audio-Tokenizer-v2 install

MOSS-Audio-Tokenizer-v2 is an open source model from GitHub that offers a free installation service, and any user can find MOSS-Audio-Tokenizer-v2 on GitHub to install. At the same time, huggingface.co provides the effect of MOSS-Audio-Tokenizer-v2 install, users can directly use MOSS-Audio-Tokenizer-v2 installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

MOSS-Audio-Tokenizer-v2 install url in huggingface.co:

https://huggingface.co/OpenMOSS-Team/MOSS-Audio-Tokenizer-v2

Url of MOSS-Audio-Tokenizer-v2

MOSS-Audio-Tokenizer-v2 huggingface.co Url

Provider of MOSS-Audio-Tokenizer-v2 huggingface.co

OpenMOSS-Team
ORGANIZATIONS

Other API from OpenMOSS-Team

huggingface.co

Total runs: 139
Run Growth: -235
Growth Rate: -156.67%
Updated:September 26 2023