Module audiocraft.models

Models for EnCodec, AudioGen, MusicGen, as well as the generic LMModel.

Expand source code
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
"""
Models for EnCodec, AudioGen, MusicGen, as well as the generic LMModel.
"""
# flake8: noqa
from . import builders, loaders
from .encodec import (
    CompressionModel, EncodecModel, DAC,
    HFEncodecModel, HFEncodecCompressionModel)
from .audiogen import AudioGen
from .lm import LMModel
from .lm_magnet import MagnetLMModel
from .multibanddiffusion import MultiBandDiffusion
from .musicgen import MusicGen
from .magnet import MAGNeT
from .unet import DiffusionUnet

Sub-modules

audiocraft.models.audiogen

Main model for using AudioGen. This will combine all the required components and provide easy access to the generation API.

audiocraft.models.builders

All the functions to build the relevant models and modules from the Hydra config.

audiocraft.models.encodec

Compression models or wrapper around existing models. Also defines the main interface that a model must follow to be usable as an audio tokenizer.

audiocraft.models.genmodel

Base implementation for audio generative models. This base implementation combines all the required components to run inference with pretrained audio …

audiocraft.models.lm
audiocraft.models.lm_magnet
audiocraft.models.loaders

Utility functions to load from the checkpoints. Each checkpoint is a torch.saved dict with the following keys: - 'xp.cfg': the hydra config as dumped …

audiocraft.models.magnet

Main model for using MAGNeT. This will combine all the required components and provide easy access to the generation API.

audiocraft.models.multibanddiffusion

Multi Band Diffusion models as described in "From Discrete Tokens to High-Fidelity Audio Using Multi-Band Diffusion" (paper link).

audiocraft.models.musicgen

Main model for using MusicGen. This will combine all the required components and provide easy access to the generation API.

audiocraft.models.unet

Pytorch Unet Module used for diffusion.