Instructions to use facebook/musicgen-stereo-medium with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use facebook/musicgen-stereo-medium with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-to-audio", model="facebook/musicgen-stereo-medium")# Load model directly from transformers import AutoProcessor, AutoModelForTextToWaveform processor = AutoProcessor.from_pretrained("facebook/musicgen-stereo-medium") model = AutoModelForTextToWaveform.from_pretrained("facebook/musicgen-stereo-medium", device_map="auto") - Audiocraft
How to use facebook/musicgen-stereo-medium with Audiocraft:
from audiocraft.models import MusicGen model = MusicGen.get_pretrained("facebook/musicgen-stereo-medium") descriptions = ['happy rock', 'energetic EDM', 'sad jazz'] wav = model.generate(descriptions) # generates 3 samples. - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -19,8 +19,8 @@ We further release a set of stereophonic capable models. Those were fine tuned f
|
|
| 19 |
from the mono models. The training data is otherwise identical and capabilities and limitations are shared with the base modes. The stereo models work by getting 2 streams of tokens from the EnCodec model, and interleaving those using
|
| 20 |
the delay pattern.
|
| 21 |
|
| 22 |
-
Stereophonic sound, also known as stereo, is a technique used to reproduce sound with depth and direction.
|
| 23 |
-
It uses two separate audio channels played through speakers or headphones
|
| 24 |
|
| 25 |
MusicGen is a text-to-music model capable of genreating high-quality music samples conditioned on text descriptions or audio prompts.
|
| 26 |
It is a single stage auto-regressive Transformer model trained over a 32kHz EnCodec tokenizer with 4 codebooks sampled at 50 Hz.
|
|
@@ -82,7 +82,7 @@ import torch
|
|
| 82 |
import soundfile as sf
|
| 83 |
from transformers import pipeline
|
| 84 |
|
| 85 |
-
synthesiser = pipeline("text-to-audio", "facebook/musicgen-stereo-
|
| 86 |
|
| 87 |
music = synthesiser("lo-fi music with a soothing melody", forward_params={"max_new_tokens": 256})
|
| 88 |
|
|
|
|
| 19 |
from the mono models. The training data is otherwise identical and capabilities and limitations are shared with the base modes. The stereo models work by getting 2 streams of tokens from the EnCodec model, and interleaving those using
|
| 20 |
the delay pattern.
|
| 21 |
|
| 22 |
+
Stereophonic sound, also known as stereo, is a technique used to reproduce sound with depth and direction.
|
| 23 |
+
It uses two separate audio channels played through speakers (or headphones), which creates the impression of sound coming from multiple directions.
|
| 24 |
|
| 25 |
MusicGen is a text-to-music model capable of genreating high-quality music samples conditioned on text descriptions or audio prompts.
|
| 26 |
It is a single stage auto-regressive Transformer model trained over a 32kHz EnCodec tokenizer with 4 codebooks sampled at 50 Hz.
|
|
|
|
| 82 |
import soundfile as sf
|
| 83 |
from transformers import pipeline
|
| 84 |
|
| 85 |
+
synthesiser = pipeline("text-to-audio", "facebook/musicgen-stereo-medium", device="cuda:0", torch_dtype=torch.float16)
|
| 86 |
|
| 87 |
music = synthesiser("lo-fi music with a soothing melody", forward_params={"max_new_tokens": 256})
|
| 88 |
|