teticio commited on
Commit
da472c4
1 Parent(s): 8bc5536

add upload to colab

Browse files
Files changed (1) hide show
  1. notebooks/test_model.ipynb +27 -3
notebooks/test_model.ipynb CHANGED
@@ -185,6 +185,32 @@
185
  "Alternatively, you can start from another audio altogether, resulting in a kind of style transfer."
186
  ]
187
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
188
  {
189
  "cell_type": "code",
190
  "execution_count": null,
@@ -195,7 +221,6 @@
195
  "outputs": [],
196
  "source": [
197
  "start_steps = 500 #@param {type:\"slider\", min:0, max:1000, step:10}\n",
198
- "audio_file = \"/home/teticio/Music/Music/Cesar Mariano And CIA/Gilles Peterson In Brazil_ Da Hora/2-07 Futebol De Bar (Heavy Üsker Mix.mp3\" #@param {type:\"string\"}\n",
199
  "audio_diffusion.mel.load_audio(audio_file)\n",
200
  "track = np.array([])\n",
201
  "generator = torch.Generator()\n",
@@ -212,8 +237,7 @@
212
  " generator=generator)\n",
213
  " display(Audio(audio, rate=sample_rate))\n",
214
  " display(Audio(audio2, rate=sample_rate))\n",
215
- " track = np.concatenate([track, audio2])\n",
216
- "display(Audio(track, rate=sample_rate))"
217
  ]
218
  },
219
  {
 
185
  "Alternatively, you can start from another audio altogether, resulting in a kind of style transfer."
186
  ]
187
  },
188
+ {
189
+ "cell_type": "code",
190
+ "execution_count": null,
191
+ "id": "fc620a80",
192
+ "metadata": {},
193
+ "outputs": [],
194
+ "source": [
195
+ "try:\n",
196
+ " # are we running on Google Colab?\n",
197
+ " from google.colab import files\n",
198
+ " audio_file = list(files.upload().keys())[0]\n",
199
+ "except:\n",
200
+ " audio_file = None"
201
+ ]
202
+ },
203
+ {
204
+ "cell_type": "code",
205
+ "execution_count": null,
206
+ "id": "ec894340",
207
+ "metadata": {},
208
+ "outputs": [],
209
+ "source": [
210
+ "if audio_file is None:\n",
211
+ " audio_file = \"/home/teticio/Music/Music/Cesar Mariano And CIA/Gilles Peterson In Brazil_ Da Hora/2-07 Futebol De Bar (Heavy Üsker Mix.mp3\""
212
+ ]
213
+ },
214
  {
215
  "cell_type": "code",
216
  "execution_count": null,
 
221
  "outputs": [],
222
  "source": [
223
  "start_steps = 500 #@param {type:\"slider\", min:0, max:1000, step:10}\n",
 
224
  "audio_diffusion.mel.load_audio(audio_file)\n",
225
  "track = np.array([])\n",
226
  "generator = torch.Generator()\n",
 
237
  " generator=generator)\n",
238
  " display(Audio(audio, rate=sample_rate))\n",
239
  " display(Audio(audio2, rate=sample_rate))\n",
240
+ " track = np.concatenate([track, audio2])"
 
241
  ]
242
  },
243
  {