baakaani commited on
Commit
cf9b3c9
1 Parent(s): baba814
Files changed (1) hide show
  1. generation_utilities.py +9 -6
generation_utilities.py CHANGED
@@ -12,6 +12,7 @@ model_name = ["SAint7579/orpheus_ldm_model_v1-0", "teticio/audio-diffusion-ddim-
12
 
13
  audio_diffusion_v0 = AudioDiffusionPipeline.from_pretrained("teticio/latent-audio-diffusion-256").to(device)
14
  audio_diffusion_v1 = AudioDiffusionPipeline.from_pretrained("SAint7579/orpheus_ldm_model_v1-0").to(device)
 
15
  ddim = AudioDiffusionPipeline.from_pretrained("teticio/audio-diffusion-ddim-256").to(device)
16
 
17
  ### Add numpy docstring to generate_from_music
@@ -166,12 +167,14 @@ def generate_songs(conditioning_songs, similarity=0.9, quality=500, merging_qual
166
  # start = np.random.randint(0, len(merged) - 5 * sample_rate)
167
  # merged = merged[start:start + 5 * sample_rate]
168
 
169
- if random.random() < 0.5:
170
- diffuser = audio_diffusion_v0
171
- model_name = "v0"
172
- else:
173
- diffuser = audio_diffusion_v1
174
- model_name = "v1"
 
 
175
  print("Generating song...")
176
  ## quality = X - similarity*X
177
  total_steps = min([1000, int(quality/(1-similarity))])
 
12
 
13
  audio_diffusion_v0 = AudioDiffusionPipeline.from_pretrained("teticio/latent-audio-diffusion-256").to(device)
14
  audio_diffusion_v1 = AudioDiffusionPipeline.from_pretrained("SAint7579/orpheus_ldm_model_v1-0").to(device)
15
+ audio_diffusion_v2 = AudioDiffusionPipeline.from_pretrained("SAint7579/orpheus_ldm_model_v2-0").to(device)
16
  ddim = AudioDiffusionPipeline.from_pretrained("teticio/audio-diffusion-ddim-256").to(device)
17
 
18
  ### Add numpy docstring to generate_from_music
 
167
  # start = np.random.randint(0, len(merged) - 5 * sample_rate)
168
  # merged = merged[start:start + 5 * sample_rate]
169
 
170
+
171
+
172
+ diffuser, model_name = random.choice([
173
+ (audio_diffusion_v0, "v0"),
174
+ (audio_diffusion_v1, "v1"),
175
+ (audio_diffusion_v2, "v2")
176
+ ])
177
+
178
  print("Generating song...")
179
  ## quality = X - similarity*X
180
  total_steps = min([1000, int(quality/(1-similarity))])