p-lambda / jukemir

Perform transfer learning for MIR using Jukebox!
MIT License
174 stars 23 forks source link

ValueError: Audio file is not long enough #11

Closed borishanzju closed 1 year ago

borishanzju commented 1 year ago

restore jukebox/models/5b/prior_level_2.pth.tar Restored from jukebox/models/5b/prior_level_2.pth.tar 0%| | 0/60 [00:35<?, ?it/s] Traceback (most recent call last): File "main.py", line 177, in representation = get_acts_from_file(input_path, hps, vqvae, top_prior, meanpool=True) File "main.py", line 86, in get_acts_from_file z = get_z(audio, vqvae) File "main.py", line 32, in get_z raise ValueError('Audio file is not long enough') ValueError: Audio file is not long enough

rodrigo-castellon commented 1 year ago

Sorry for the late response. You can see exactly why this gets raised https://github.com/p-lambda/jukemir/blob/96d67b9af0d62f39ac0cd656d09ea63a08a13b31/representations/jukebox/main.py#L31 The API asks for audio of at least ~24 seconds.

borishanzju commented 1 year ago

How can I adopt the repo to short audio

rodrigo-castellon commented 1 year ago

I'd recommend taking a look at the colab notebook. The notebook code supports this capability.