Comments (4)
Do you mean trimming the audio to a desired length after generating a 10-second long sample? This is easily doable by truncating the generated wave in tango.py
:
def generate(self, prompt, steps=100, guidance=3, samples=1, disable_progress=True, desired_length_in_seconds=10):
""" Genrate audio for a single prompt string. """
with torch.no_grad():
latents = self.model.inference([prompt], self.scheduler, steps, guidance, samples, disable_progress=disable_progress)
mel = self.vae.decode_first_stage(latents)
wave = self.vae.decode_to_waveform(mel)
# Sampling rate is 16 KHz
wave = wave[:, desired_length_in_seconds * 16000]
return wave[0]
However, constraining the generated audio such that the events described in the text appear within the first n
seconds is not straightforward to control. The nature of the training dataset results in the generated audio having the events described in the text prompt being spread over the entire 10 seconds duration.
from tango.
yes, I meant to get the events within n seconds. do you mean if I trained it on a short-length audio files, I get short results too? what length should the dataset be in ur opinion? and what do you think should be done to control the length of the audio?
from tango.
You need to train on shorter audio samples to achieve the control. The duration
variable in train.py specifies the length of the audio in seconds. It is set to 10 which you can reduce to a smaller number and train with appropriate short audio samples.
from tango.
Thanks 😁
from tango.
Related Issues (20)
- HOW MUCH VRAM IS REQUIRED FOR INFERENCE? HOT 2
- Inference HOT 7
- Producing audio in different Sample Rate HOT 3
- The vae decoder cannot recover original audio with the extracted latent code HOT 1
- Could you provide the ChatGPT prompt of sound? HOT 1
- Is it possible to do fine tuning and incremental training? HOT 1
- Can I retrain the model on the audiocaps dataset with a 24GB 4090?
- Question about inference_hf.py HOT 1
- AttributeError: 'AudioDiffusion' object has no attribute 'device' HOT 4
- Downloading AudioCaps data HOT 1
- about tango-full-ft-audiocaps HOT 1
- About data augment HOT 2
- Reproduce result
- License HOT 5
- Hardware. HOT 2
- Classifier-free guidance(CFG) in training vs inference HOT 1
- Preview and save multiple samples of the same prompt HOT 2
- What is the proper loss value? My train and val loss is around 6.5-6.6 and do not drop.
- about audio_alphaca_15k.json file? HOT 1
- Fine-Tuning TANGO 2 HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tango.