Update README.md
#5
by
reach-vb
HF staff
- opened
README.md
CHANGED
@@ -75,10 +75,11 @@ pip install --upgrade git+https://github.com/huggingface/transformers.git scipy
|
|
75 |
2. Run inference via the `Text-to-Audio` (TTA) pipeline. You can infer the MusicGen model via the TTA pipeline in just a few lines of code!
|
76 |
|
77 |
```python
|
78 |
-
from transformers import pipeline
|
79 |
import scipy
|
|
|
|
|
80 |
|
81 |
-
synthesiser = pipeline("text-to-audio", "facebook/musicgen-stereo-small", device="cuda")
|
82 |
|
83 |
music = synthesiser("lo-fi music with a soothing melody", forward_params={"do_sample": True})
|
84 |
|
|
|
75 |
2. Run inference via the `Text-to-Audio` (TTA) pipeline. You can infer the MusicGen model via the TTA pipeline in just a few lines of code!
|
76 |
|
77 |
```python
|
|
|
78 |
import scipy
|
79 |
+
import torch
|
80 |
+
from transformers import pipeline
|
81 |
|
82 |
+
synthesiser = pipeline("text-to-audio", "facebook/musicgen-stereo-small", device="cuda", torch_dtype=torch.float16)
|
83 |
|
84 |
music = synthesiser("lo-fi music with a soothing melody", forward_params={"do_sample": True})
|
85 |
|