soujanyaporia
commited on
Commit
•
82b582b
1
Parent(s):
395b4aa
Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,69 @@
|
|
1 |
---
|
2 |
license: cc-by-nc-sa-4.0
|
|
|
|
|
|
|
|
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
license: cc-by-nc-sa-4.0
|
3 |
+
datasets:
|
4 |
+
- bjoernp/AudioCaps
|
5 |
+
language:
|
6 |
+
- en
|
7 |
---
|
8 |
+
# TANGO: Text to Audio using iNstruction-Guided diffusiOn
|
9 |
+
|
10 |
+
**TANGO** is a latent diffusion model for text to audio generation. **TANGO** can generate realistic audios including human sounds, animal sounds, natural and artificial sounds and sound effects from textual prompts. We use the frozen instruction-tuned LLM Flan-T5 as the text encoder and train a UNet based diffusion model for audio generation. We outperform current state-of-the-art models for audio generation across both objective and subjective metrics. We release our model, training, inference code and pre-trained checkpoints for the research community.
|
11 |
+
|
12 |
+
📣 We are releasing **Tango-Full-FT** which was first pre-trained on **TangoPromptBank** and later fine tuned on AudioCaps. This checkpoint obtained state-of-the-art results for text-to-audio generation on AudioCaps.
|
13 |
+
|
14 |
+
## Code
|
15 |
+
|
16 |
+
Our code is released here: [https://github.com/declare-lab/tango](https://github.com/declare-lab/tango)
|
17 |
+
|
18 |
+
We uploaded several **TANGO** generated samples here: [https://tango-web.github.io/](https://tango-web.github.io/)
|
19 |
+
|
20 |
+
Please follow the instructions in the repository for installation, usage and experiments.
|
21 |
+
|
22 |
+
## Quickstart Guide
|
23 |
+
|
24 |
+
Download the **TANGO** model and generate audio from a text prompt:
|
25 |
+
|
26 |
+
```python
|
27 |
+
import IPython
|
28 |
+
import soundfile as sf
|
29 |
+
from tango import Tango
|
30 |
+
|
31 |
+
tango = Tango("declare-lab/tango-full-ft")
|
32 |
+
|
33 |
+
prompt = "An audience cheering and clapping"
|
34 |
+
audio = tango.generate(prompt)
|
35 |
+
sf.write(f"{prompt}.wav", audio, samplerate=16000)
|
36 |
+
IPython.display.Audio(data=audio, rate=16000)
|
37 |
+
```
|
38 |
+
[An audience cheering and clapping.webm](https://user-images.githubusercontent.com/13917097/233851915-e702524d-cd35-43f7-93e0-86ea579231a7.webm)
|
39 |
+
|
40 |
+
The model will be automatically downloaded and saved in cache. Subsequent runs will load the model directly from cache.
|
41 |
+
|
42 |
+
The `generate` function uses 100 steps by default to sample from the latent diffusion model. We recommend using 200 steps for generating better quality audios. This comes at the cost of increased run-time.
|
43 |
+
|
44 |
+
```python
|
45 |
+
prompt = "Rolling thunder with lightning strikes"
|
46 |
+
audio = tango.generate(prompt, steps=200)
|
47 |
+
IPython.display.Audio(data=audio, rate=16000)
|
48 |
+
```
|
49 |
+
[Rolling thunder with lightning strikes.webm](https://user-images.githubusercontent.com/13917097/233851929-90501e41-911d-453f-a00b-b215743365b4.webm)
|
50 |
+
|
51 |
+
<!-- [MachineClicking](https://user-images.githubusercontent.com/25340239/233857834-bfda52b4-4fcc-48de-b47a-6a6ddcb3671b.mp4 "sample 1") -->
|
52 |
+
|
53 |
+
Use the `generate_for_batch` function to generate multiple audio samples for a batch of text prompts:
|
54 |
+
|
55 |
+
```python
|
56 |
+
prompts = [
|
57 |
+
"A car engine revving",
|
58 |
+
"A dog barks and rustles with some clicking",
|
59 |
+
"Water flowing and trickling"
|
60 |
+
]
|
61 |
+
audios = tango.generate_for_batch(prompts, samples=2)
|
62 |
+
```
|
63 |
+
This will generate two samples for each of the three text prompts.
|
64 |
+
|
65 |
+
## Limitations
|
66 |
+
|
67 |
+
TANGO is trained on the small AudioCaps dataset so it may not generate good audio samples related to concepts that it has not seen in training (e.g. _singing_). For the same reason, TANGO is not always able to finely control its generations over textual control prompts. For example, the generations from TANGO for prompts _Chopping tomatoes on a wooden table_ and _Chopping potatoes on a metal table_ are very similar. _Chopping vegetables on a table_ also produces similar audio samples. Training text-to-audio generation models on larger datasets is thus required for the model to learn the composition of textual concepts and varied text-audio mappings.
|
68 |
+
|
69 |
+
We are training another version of TANGO on larger datasets to enhance its generalization, compositional and controllable generation ability.
|