Instructions to use declare-lab/tango2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use declare-lab/tango2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-to-audio", model="declare-lab/tango2")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("declare-lab/tango2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -36,7 +36,6 @@ audio = tango.generate(prompt)
|
|
| 36 |
sf.write(f"{prompt}.wav", audio, samplerate=16000)
|
| 37 |
IPython.display.Audio(data=audio, rate=16000)
|
| 38 |
```
|
| 39 |
-
[An audience cheering and clapping.webm](https://user-images.githubusercontent.com/13917097/233851915-e702524d-cd35-43f7-93e0-86ea579231a7.webm)
|
| 40 |
|
| 41 |
The model will be automatically downloaded and saved in cache. Subsequent runs will load the model directly from cache.
|
| 42 |
|
|
@@ -47,9 +46,7 @@ prompt = "Rolling thunder with lightning strikes"
|
|
| 47 |
audio = tango.generate(prompt, steps=200)
|
| 48 |
IPython.display.Audio(data=audio, rate=16000)
|
| 49 |
```
|
| 50 |
-
[Rolling thunder with lightning strikes.webm](https://user-images.githubusercontent.com/13917097/233851929-90501e41-911d-453f-a00b-b215743365b4.webm)
|
| 51 |
|
| 52 |
-
<!-- [MachineClicking](https://user-images.githubusercontent.com/25340239/233857834-bfda52b4-4fcc-48de-b47a-6a6ddcb3671b.mp4 "sample 1") -->
|
| 53 |
|
| 54 |
Use the `generate_for_batch` function to generate multiple audio samples for a batch of text prompts:
|
| 55 |
|
|
|
|
| 36 |
sf.write(f"{prompt}.wav", audio, samplerate=16000)
|
| 37 |
IPython.display.Audio(data=audio, rate=16000)
|
| 38 |
```
|
|
|
|
| 39 |
|
| 40 |
The model will be automatically downloaded and saved in cache. Subsequent runs will load the model directly from cache.
|
| 41 |
|
|
|
|
| 46 |
audio = tango.generate(prompt, steps=200)
|
| 47 |
IPython.display.Audio(data=audio, rate=16000)
|
| 48 |
```
|
|
|
|
| 49 |
|
|
|
|
| 50 |
|
| 51 |
Use the `generate_for_batch` function to generate multiple audio samples for a batch of text prompts:
|
| 52 |
|