AI SeedbankHelp preserve open and free AI for humanity's future

← All models

facebook_encodec_24khz

facebook · View on Hugging Face ↗

Get this model

Download TorrentMagnet Link

Seeders: · Leechers:

Model card

The complete upstream card, rendered from this payload's README.md — the same hash-verified bytes the torrent distributes. Images and off-site links are removed; the original card on Hugging Face carries them.


inference: false

Model Card for EnCodec

This model card provides details and information about EnCodec, a state-of-the-art real-time audio codec developed by Meta AI.

Model Details

Model Description

EnCodec is a high-fidelity audio codec leveraging neural networks. It introduces a streaming encoder-decoder architecture with quantized latent space, trained in an end-to-end fashion. The model simplifies and speeds up training using a single multiscale spectrogram adversary that efficiently reduces artifacts and produces high-quality samples. It also includes a novel loss balancer mechanism that stabilizes training by decoupling the choice of hyperparameters from the typical scale of the loss. Additionally, lightweight Transformer models are used to further compress the obtained representation while maintaining real-time performance.

  • Developed by: Meta AI
  • Model type: Audio Codec

Model Sources

  • Repository: GitHub Repository
  • Paper: EnCodec: End-to-End Neural Audio Codec

Uses

Direct Use

EnCodec can be used directly as an audio codec for real-time compression and decompression of audio signals. It provides high-quality audio compression and efficient decoding. The model was trained on various bandwiths, which can be specified when encoding (compressing) and decoding (decompressing). Two different setup exist for EnCodec:

  • Non-streamable: the input audio is split into chunks of 1 seconds, with an overlap of 10 ms, which are then encoded.
  • Streamable: weight normalizationis used on the convolution layers, and the input is not split into chunks but rather padded on the left.

Downstream Use

EnCodec can be fine-tuned for specific audio tasks or integrated into larger audio processing pipelines for applications such as speech generation, music generation, or text to speech tasks.

[More Information Needed]

How to Get Started with the Model

Use the following code to get started with the EnCodec model using a dummy example from the LibriSpeech dataset (~9MB). First, install the required Python packages:

pip install --upgrade pip
pip install --upgrade datasets[audio]
pip install git+https://github.com/huggingface/transformers.git@main

Then load an audio sample, and run a forward pass of the model:

from datasets import load_dataset, Audio
from transformers import EncodecModel, AutoProcessor


# load a demonstration datasets
librispeech_dummy = load_dataset("hf-internal-testing/librispeech_asr_dummy", "clean", split="validation")

# load the model + processor (for pre-processing the audio)
model = EncodecModel.from_pretrained("facebook/encodec_24khz")
processor = AutoProcessor.from_pretrained("facebook/encodec_24khz")

# cast the audio data to the correct sampling rate for the model
librispeech_dummy = librispeech_dummy.cast_column("audio", Audio(sampling_rate=processor.sampling_rate))
audio_sample = librispeech_dummy[0]["audio"]["array"]

# pre-process the inputs
inputs = processor(raw_audio=audio_sample, sampling_rate=processor.sampling_rate, return_tensors="pt")

# explicitly encode then decode the audio inputs
encoder_outputs = model.encode(inputs["input_values"], inputs["padding_mask"])
audio_values = model.decode(encoder_outputs.audio_codes, encoder_outputs.audio_scales, inputs["padding_mask"])[0]

# or the equivalent with a forward pass
audio_values = model(inputs["input_values"], inputs["padding_mask"]).audio_values

Training Details

The model was trained for 300 epochs, with one epoch being 2,000 updates with the Adam optimizer with a batch size of 64 examples of 1 second each, a learning rate of 3 · 10−4 , β1 = 0.5, and β2 = 0.9. All the models are traind using 8 A100 GPUs.

Training Data

They used four different training strategies to sample for these datasets:

  • (s1) sample a single source from Jamendo with probability 0.32;
  • (s2) sample a single source from the other datasets with the same probability;
  • (s3) mix two sources from all datasets with a probability of 0.24;
  • (s4) mix three sources from all datasets except music with a probability of 0.12.

The audio is normalized by file and a random gain between -10 and 6 dB id applied.

Evaluation

Subjectif metric for restoration:

This models was evalutated using the MUSHRA protocol (Series, 2014), using both a hidden reference and a low anchor. Annotators were recruited using a crowd-sourcing platform, in which they were asked to rate the perceptual quality of the provided samples in a range between 1 to 100. They randomly select 50 samples of 5 seconds from each category of the the test set and force at least 10 annotations per samples. To filter noisy annotations and outliers we remove annotators who rate the reference recordings less then 90 in at least 20% of the cases, or rate the low-anchor recording above 80 more than 50% of the time.

Objective metric for restoration:

The ViSQOL()ink) metric was used together with the Scale-Invariant Signal-to-Noise Ration (SI-SNR) (Luo & Mesgarani, 2019; Nachmani et al., 2020; Chazan et al., 2021).

Results

The results of the evaluation demonstrate the superiority of EnCodec compared to the baselines across different bandwidths (1.5, 3, 6, and 12 kbps).

When comparing EnCodec with the baselines at the same bandwidth, EnCodec consistently outperforms them in terms of MUSHRA score. Notably, EnCodec achieves better performance, on average, at 3 kbps compared to Lyra-v2 at 6 kbps and Opus at 12 kbps. Additionally, by incorporating the language model over the codes, it is possible to achieve a bandwidth reduction of approximately 25-40%. For example, the bandwidth of the 3 kbps model can be reduced to 1.9 kbps.

Summary

EnCodec is a state-of-the-art real-time neural audio compression model that excels in producing high-fidelity audio samples at various sample rates and bandwidths. The model's performance was evaluated across different settings, ranging from 24kHz monophonic at 1.5 kbps to 48kHz stereophonic, showcasing both subjective and objective results. Notably, EnCodec incorporates a novel spectrogram-only adversarial loss, effectively reducing artifacts and enhancing sample quality. Training stability and interpretability were further enhanced through the introduction of a gradient balancer for the loss weights. Additionally, the study demonstrated that a compact Transformer model can be employed to achieve an additional bandwidth reduction of up to 40% without compromising quality, particularly in applications where low latency is not critical (e.g., music streaming).

Citation

BibTeX:

@misc{défossez2022high,
      title={High Fidelity Neural Audio Compression}, 
      author={Alexandre Défossez and Jade Copet and Gabriel Synnaeve and Yossi Adi},
      year={2022},
      eprint={2210.13438},
      archivePrefix={arXiv},
      primaryClass={eess.AS}
}

Magnet link

Opens the swarm directly in your torrent client — no file download needed. Copy-paste works too:

magnet:?xt=urn:btih:4cf3b1999a4ea3555d0c62eae54b8ec7c19af706&dn=facebook_encodec_24khz

Open magnet in torrent client · infohash 4cf3b1999a4ea3555d0c62eae54b8ec7c19af706

Files & hashes

PathSizesha1sha256
README.md8.1 KB (8,287 B)e6b1e7f70933e718a8e03d4f58de280676ee656fa39054887b1633f5c0fdd561eade184900044f61e34b03e9af742b208a548251
config.json809 B (809 B)1193127644b437e94e1e69a696480b828dc6cdb7cd7da7da3b3b34daee262e213e3daa24dc01b4fdc3aadd38ed760f0d6f955871
model.safetensors88.8 MB (93,119,608 B)67549021e5529e677f8c90f04c2f8130ea985a0937a7cb100f71a29e6c1d815aca8666a1d7ea8885ebe44c306c751a5103559d57
preprocessor_config.json234 B (234 B)ba40914f4f49ab98a8ca545d4892ef7291a39592fcb3805e597e786d4067706e602f6688524640f8d3396790e2e09b5942fcbdfb
pytorch_model.bin88.9 MB (93,172,669 B)801c9afcb91388b303af6623bc31e5e0b531531d723be8b6cb82e6c4ca60e315e71d1be1c1355fc027dadae352628341d5f0e1f1

Cite this release

Canonical URL
https://aiseedbank.org/models/facebook_encodec_24khz/
Slug
facebook_encodec_24khz
Infohash
4cf3b1999a4ea3555d0c62eae54b8ec7c19af706
License
no license recorded
Signing key fingerprint
85a3b32c3712427b

Every file carries a locally computed sha256 — verify a download against the signed sums: facebook_encodec_24khz.SHA256SUMS (+ minisign signature).

Provenance

Upstream repositoryfacebook/encodec_24khz
Revision (pinned)c1dbe2ae3f1de713481a3b3e7c47f357092ee040
Fetched at2026-09-03T22:34:00Z
License at fetchno license recorded
Snapshot toolhuggingface · seedbank 0.1.0

Trackers

✓ verified · rehash-vs-hf-metadata at 2026-09-03T22:34:04Z

no license recorded177.7 MB (186,301,607 bytes)transformerspytorchsafetensorsencodecfeature-extractionpaper: 2210.13438