Instructions to use facebook/musicgen-medium with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use facebook/musicgen-medium with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-to-audio", model="facebook/musicgen-medium")# Load model directly from transformers import AutoProcessor, AutoModelForTextToWaveform processor = AutoProcessor.from_pretrained("facebook/musicgen-medium") model = AutoModelForTextToWaveform.from_pretrained("facebook/musicgen-medium") - Notebooks
- Google Colab
- Kaggle
Update README.md
#9
by reach-vb - opened
README.md
CHANGED
|
@@ -71,7 +71,7 @@ synthesiser = pipeline("text-to-audio", "facebook/musicgen-medium")
|
|
| 71 |
|
| 72 |
music = synthesiser("lo-fi music with a soothing melody", forward_params={"do_sample": True})
|
| 73 |
|
| 74 |
-
scipy.io.wavfile.write("musicgen_out.wav", rate=music["sampling_rate"],
|
| 75 |
```
|
| 76 |
|
| 77 |
3. Run inference via the Transformers modelling code. You can use the processor + generate code to convert text into a mono 32 kHz audio waveform for more fine-grained control.
|
|
@@ -122,7 +122,7 @@ pip install git+https://github.com/facebookresearch/audiocraft.git
|
|
| 122 |
|
| 123 |
2. Make sure to have [`ffmpeg`](https://ffmpeg.org/download.html) installed:
|
| 124 |
```
|
| 125 |
-
apt
|
| 126 |
```
|
| 127 |
|
| 128 |
3. Run the following Python code:
|
|
|
|
| 71 |
|
| 72 |
music = synthesiser("lo-fi music with a soothing melody", forward_params={"do_sample": True})
|
| 73 |
|
| 74 |
+
scipy.io.wavfile.write("musicgen_out.wav", rate=music["sampling_rate"], data=music["audio"])
|
| 75 |
```
|
| 76 |
|
| 77 |
3. Run inference via the Transformers modelling code. You can use the processor + generate code to convert text into a mono 32 kHz audio waveform for more fine-grained control.
|
|
|
|
| 122 |
|
| 123 |
2. Make sure to have [`ffmpeg`](https://ffmpeg.org/download.html) installed:
|
| 124 |
```
|
| 125 |
+
apt-get install ffmpeg
|
| 126 |
```
|
| 127 |
|
| 128 |
3. Run the following Python code:
|