teticio commited on
Commit
37c17e0
1 Parent(s): 4033ea7

fix steps=None

Browse files
audiodiffusion/__init__.py CHANGED
@@ -206,7 +206,9 @@ class AudioDiffusionPipeline(DiffusionPipeline):
206
  if start_step > 0:
207
  images[0, 0] = self.scheduler.add_noise(
208
  torch.tensor(input_images[:, np.newaxis, np.newaxis, :]),
209
- noise, torch.tensor(steps - start_step))
 
 
210
 
211
  pixels_per_second = (mel.get_sample_rate() / mel.hop_length)
212
  mask_start = int(mask_start_secs * pixels_per_second)
 
206
  if start_step > 0:
207
  images[0, 0] = self.scheduler.add_noise(
208
  torch.tensor(input_images[:, np.newaxis, np.newaxis, :]),
209
+ noise,
210
+ torch.tensor(self.scheduler.num_train_timesteps -
211
+ start_step))
212
 
213
  pixels_per_second = (mel.get_sample_rate() / mel.hop_length)
214
  mask_start = int(mask_start_secs * pixels_per_second)
notebooks/test_model.ipynb CHANGED
@@ -136,21 +136,6 @@
136
  "Try playing around with `start_steps`. Values closer to zero will produce new samples, while values closer to 1,000 will produce samples more faithful to the original."
137
  ]
138
  },
139
- {
140
- "cell_type": "code",
141
- "execution_count": null,
142
- "id": "a7e637e5",
143
- "metadata": {},
144
- "outputs": [],
145
- "source": [
146
- "seed = 16183389798189209330 #@param {type:\"integer\"}\n",
147
- "generator.manual_seed(seed)\n",
148
- "image, (sample_rate, audio) = audio_diffusion.generate_spectrogram_and_audio(\n",
149
- " generator=generator)\n",
150
- "display(image)\n",
151
- "display(Audio(audio, rate=sample_rate))"
152
- ]
153
- },
154
  {
155
  "cell_type": "code",
156
  "execution_count": null,
 
136
  "Try playing around with `start_steps`. Values closer to zero will produce new samples, while values closer to 1,000 will produce samples more faithful to the original."
137
  ]
138
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
139
  {
140
  "cell_type": "code",
141
  "execution_count": null,