Feature Extraction
Transformers
Safetensors
moss-audio-tokenizer
audio
audio-tokenizer
neural-codec
moss-tts-family
MOSS Audio Tokenizer
speech-tokenizer
trust-remote-code
custom_code
Run this model with HF Jobs
Run OpenMOSS-Team/MOSS-Audio-Tokenizer on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/OpenMOSS-Team/MOSS-Audio-Tokenizer. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/OpenMOSS-Team/MOSS-Audio-Tokenizer on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use OpenMOSS-Team/MOSS-Audio-Tokenizer with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use OpenMOSS-Team/MOSS-Audio-Tokenizer with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="OpenMOSS-Team/MOSS-Audio-Tokenizer", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("OpenMOSS-Team/MOSS-Audio-Tokenizer", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Commit ·
66562e3
1
Parent(s): 4a52ecf
modify readme (#2)
Browse files- modify readme (f9c0141315f2c2fe1fb6442a19af4a13f49eda15)
Co-authored-by: yitian gong <fdugyt@users.noreply.huggingface.co>
12 unmodified lines13141516171819208 unmodified lines2930313233343536373839404142434445464748495051525354555657585958 unmodified lines11811912012112212312412512612712 unmodified lines# MossAudioTokenizerMossAudioTokenizer is a Transformer-based neural audio tokenizer model jointly optimizing the encoder, quantizer, and decoder from scratch for high-fidelity reconstruction of general audio, audio tokenization and synthesis.Both the encoder and decoder of MossAudioTokenizer contain approximately 0.8 billion parameters each, totaling about 1.6 billion. MossAudioTokenizer operates at 12.5 Hz, uses a 32-layer residual vector quantizer (RVQ), and supports variable-codebook decoding.This repository contains a lightweight remote-code implementation that mirrors the current 🤗 Transformers`transformers.models.moss_audio_tokenizer` module. It is intended to be uploaded to a Hugging Face Hub model repository8 unmodified lines## Usage### Installation```bashcd MOSS-Audio-Tokenizerpip install -r requirements.txt```### Quickstart```pythonimport torchfrom transformers import AutoModelrepo_id = "OpenMOSS-Team/MOSS-Audio-Tokenizer"model = AutoModel.from_pretrained(repo_id, trust_remote_code=True).eval()audio = torch.randn(1, 1, 3200) # dummy waveformenc = model.encode(audio, 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}")```### Quickstart (Waveform I/O)```pythonimport torchfrom transformers import AutoModel58 unmodified lines- Audio metrics are evaluated on the AudioSet evaluation subset, while music metrics are evaluated on MUSDB, reported as audio/music.- STFT-Dist. denotes the STFT distance.- Higher is better for speech metrics, while lower is better for audio/music metrics (Mel-Loss, STFT-Dist.).- $\boldsymbol{N}_{\mathrm{VQ}}$ denotes the number of quantizers.| Model | bps | Frame rate | $\boldsymbol{N}_{\mathrm{VQ}}$ | Speech: SIM ↑ (EN/ZH) | Speech: STOI ↑ (EN/ZH) | Speech: PESQ-NB ↑ (EN/ZH) | Speech: PESQ-WB ↑ (EN/ZH) | Audio/Music: Mel-Loss ↓ | Audio/Music: STFT-Dist. ↓ || --- | ---: | ---: | ---: | --- | --- | --- | --- | --- | --- || **XCodec2.0** | 800 | 50 | 1 | 0.82 / 0.74 | 0.92 / 0.86 | 3.04 / 2.46 | 2.43 / 1.96 | -- / -- | -- / -- || **MiMo Audio Tokenizer** | 850 | 25 | 4 | 0.80 / 0.74 | 0.91 / 0.87 | 2.94 / 2.62 | 2.39 / 2.14 | **0.82** / 0.81 | 2.33 / 2.23 || **Higgs Audio Tokenizer** | 1000 | 25 | 4 | 0.77 / 0.68 | 0.83 / 0.82 | 3.03 / 2.61 | 2.48 / 2.14 | 0.83 / **0.80** | 2.20 / 2.05 |12 unmodified lines131415161718198 unmodified lines282930313233343558 unmodified lines94959697989910010110210312 unmodified lines# MossAudioTokenizerMOSS Audio Tokenizer is a unified audio tokenizer designed to achieve both high-fidelity reconstruction and semantically rich representations across speech, sound, and music. Built on the Cat (**C**ausal **A**udio **T**okenizer with **T**ransformer) architecture, the model scales to 1.6 billion parameters and was trained on 3 million hours of audio, surpassing previous open-source tokenizers in reconstruction quality across all bitrates. It processes 24 kHz audio at a low 12.5 Hz frame rate, with all components—including the encoder, quantizer, decoder, decoder-only LLM, and discriminator—optimized jointly in an end-to-end manner. Featuring a 32-layer residual vector quantizer (RVQ) with variable-bitrate support, it provides a scalable, native foundation for the next generation of autoregressive audio foundation models.This repository contains a lightweight remote-code implementation that mirrors the current 🤗 Transformers`transformers.models.moss_audio_tokenizer` module. It is intended to be uploaded to a Hugging Face Hub model repository8 unmodified lines## Usage### Quickstart```pythonimport torchfrom transformers import AutoModel58 unmodified lines- Audio metrics are evaluated on the AudioSet evaluation subset, while music metrics are evaluated on MUSDB, reported as audio/music.- STFT-Dist. denotes the STFT distance.- Higher is better for speech metrics, while lower is better for audio/music metrics (Mel-Loss, STFT-Dist.).- Nq denotes the number of quantizers.| Model | bps | Frame rate | Nq | Speech: SIM ↑ (EN/ZH) | Speech: STOI ↑ (EN/ZH) | Speech: PESQ-NB ↑ (EN/ZH) | Speech: PESQ-WB ↑ (EN/ZH) | Audio/Music: Mel-Loss ↓ | Audio/Music: STFT-Dist. ↓ || :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: || **XCodec2.0** | 800 | 50 | 1 | 0.82 / 0.74 | 0.92 / 0.86 | 3.04 / 2.46 | 2.43 / 1.96 | -- / -- | -- / -- || **MiMo Audio Tokenizer** | 850 | 25 | 4 | 0.80 / 0.74 | 0.91 / 0.87 | 2.94 / 2.62 | 2.39 / 2.14 | **0.82** / 0.81 | 2.33 / 2.23 || **Higgs Audio Tokenizer** | 1000 | 25 | 4 | 0.77 / 0.68 | 0.83 / 0.82 | 3.03 / 2.61 | 2.48 / 2.14 | 0.83 / **0.80** | 2.20 / 2.05 |
README.md+4-28