## Basic model info

Model name: lucataco/magnet
Model description: MAGNeT: Masked Audio Generation using a Single Non-Autoregressive Transformer


## Model inputs

- prompt (optional): Input Text (string)
- model (optional): Model to use (string)
- variations (optional): Number of variations to generate (integer)
- span_score (optional): An enumeration. (string)
- temperature (optional): Temperature for sampling (number)
- top_p (optional): Top p for sampling (number)
- max_cfg (optional): Max CFG coefficient (number)
- min_cfg (optional): Min CFG coefficient (number)
- decoding_steps_stage_1 (optional): Number of decoding steps for stage 1 (integer)
- decoding_steps_stage_2 (optional): Number of decoding steps for stage 2 (integer)
- decoding_steps_stage_3 (optional): Number of decoding steps for stage 3 (integer)
- decoding_steps_stage_4 (optional): Number of decoding steps for stage 4 (integer)


## Model output schema

{
  "type": "array",
  "items": {
    "type": "string",
    "format": "uri"
  },
  "title": "Output"
}

If the input or output schema includes a format of URI, it is referring to a file.


## Example inputs and outputs

Use these example outputs to better understand the types of inputs the model accepts, and the types of outputs the model returns:

### Example (https://replicate.com/p/6usmrb3bog2on4b52tcnpt74oa)

#### Input

```json
{
  "model": "facebook/magnet-small-10secs",
  "top_p": 0.9,
  "prompt": "80s electronic track with melodic synthesizers, catchy beat and groovy bass",
  "max_cfg": 10,
  "min_cfg": 1,
  "span_score": "prod-stride1",
  "variations": 3,
  "temperature": 3,
  "decoding_steps_stage_1": 20,
  "decoding_steps_stage_2": 10,
  "decoding_steps_stage_3": 10,
  "decoding_steps_stage_4": 10
}
```

#### Output

```json
[
  "https://replicate.delivery/pbxt/A09884lLfO3qWidseZLbU90KjWL3eteHOcSafheMaucmacXjE/0.wav",
  "https://replicate.delivery/pbxt/dG0LoAeZINxcf0xueWgwgNHyF2tQv3Lvo7S7HfEew2JbNurRC/1.wav",
  "https://replicate.delivery/pbxt/K55hoe139wzvBqXV4pkfDMfqbqRMaYVnJ6O8M1efLbteacXjE/2.wav"
]
```


## Model readme

> Cog implementation of [facebookresearch/MAGNeT](https://github.com/facebookresearch/audiocraft/blob/main/docs/MAGNET.md)
> 
> ## Model Details
> 
> Organization developing the model: The FAIR team of Meta AI.
> 
> Model date: MAGNeT was trained between November 2023 and January 2024.
> 
> Model version: This is the version 1 of the model.
> 
> Model type: MAGNeT consists of an EnCodec model for audio tokenization, and a non-autoregressive model based on the transformer architecture for music modeling. The model comes in different sizes: 300M and 1.5B; and two variants: a model trained for text-to-music generation, and a model trained for text-to-sound generation.
> 
> Paper or resources for more information: More information can be found in the paper Masked Audio Generation using a Single Non-Autoregressive Transformer.
> 
> Citation details: See our paper
> 
> License: Code is released under MIT, model weights are released under CC-BY-NC 4.0.
> 
> Where to send questions or comments about the model: Questions and comments about MAGNeT can be sent via the GitHub repository of the project, or by opening an issue.
> 
> ## Intended Use
> 
> Primary intended use: The primary use of MAGNeT is research on AI-based music generation, including:
> 
> * Research efforts, such as probing and better understanding the limitations of generative models to further improve the state of science
> * Generation of music guided by text to understand current abilities of generative AI models by machine learning amateurs
> 
> Primary intended users: The primary intended users of the model are researchers in audio, machine learning and artificial intelligence, as well as amateur seeking to better understand those models.
> 
> Out-of-scope use cases: The model should not be used on downstream applications without further risk evaluation and mitigation. The model should not be used to intentionally create or disseminate music pieces that create hostile or alienating environments for people. This includes generating music that people would foreseeably find disturbing, distressing, or offensive; or content that propagates historical or current stereotypes.
> 
> ```
> @misc{ziv2024masked,
>       title={Masked Audio Generation using a Single Non-Autoregressive Transformer}, 
>       author={Alon Ziv and Itai Gat and Gael Le Lan and Tal Remez and Felix Kreuk and Alexandre Défossez and Jade Copet and Gabriel Synnaeve and Yossi Adi},
>       year={2024},
>       eprint={2401.04577},
>       archivePrefix={arXiv},
>       primaryClass={cs.SD}
> }
> ```

