patrickvonplaten commited on
Commit
cbf68c9
1 Parent(s): 241e3fb

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +5 -3
README.md CHANGED
@@ -49,13 +49,15 @@ apt get install ffmpeg
49
  import torchaudio
50
  from audiocraft.models import MusicGen
51
  from audiocraft.data.audio import audio_write
52
- model = MusicGen.get_pretrained('melody')
 
53
  model.set_generation_params(duration=8) # generate 8 seconds.
 
54
  wav = model.generate_unconditional(4) # generates 4 unconditional audio samples
55
  descriptions = ['happy rock', 'energetic EDM', 'sad jazz']
 
56
  wav = model.generate(descriptions) # generates 3 samples.
57
- melody, sr = torchaudio.load('./assets/bach.mp3')
58
- # generates using the melody from the given audio and the provided descriptions.
59
  wav = model.generate_with_chroma(descriptions, melody[None].expand(3, -1, -1), sr)
60
  for idx, one_wav in enumerate(wav):
61
  # Will save under {idx}.wav, with loudness normalization at -14 db LUFS.
 
49
  import torchaudio
50
  from audiocraft.models import MusicGen
51
  from audiocraft.data.audio import audio_write
52
+
53
+ model = MusicGen.get_pretrained('small')
54
  model.set_generation_params(duration=8) # generate 8 seconds.
55
+
56
  wav = model.generate_unconditional(4) # generates 4 unconditional audio samples
57
  descriptions = ['happy rock', 'energetic EDM', 'sad jazz']
58
+
59
  wav = model.generate(descriptions) # generates 3 samples.
60
+
 
61
  wav = model.generate_with_chroma(descriptions, melody[None].expand(3, -1, -1), sr)
62
  for idx, one_wav in enumerate(wav):
63
  # Will save under {idx}.wav, with loudness normalization at -14 db LUFS.