dslee2601 commited on
Commit
00d4f44
·
1 Parent(s): aa88eb2

save notebook output

Browse files
Files changed (1) hide show
  1. save_model.ipynb +4 -11
save_model.ipynb CHANGED
@@ -161,17 +161,10 @@
161
  "metadata": {},
162
  "outputs": [
163
  {
164
- "ename": "RuntimeError",
165
- "evalue": "The size of tensor a (1600) must match the size of tensor b (1592) at non-singleton dimension 2",
166
- "output_type": "error",
167
- "traceback": [
168
- "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
169
- "\u001b[1;31mRuntimeError\u001b[0m Traceback (most recent call last)",
170
- "Cell \u001b[1;32mIn[3], line 2\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[38;5;66;03m# decoding (from zq -- discrete latent vectors)\u001b[39;00m\n\u001b[1;32m----> 2\u001b[0m waveform \u001b[38;5;241m=\u001b[39m \u001b[43mmodel\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mdecode\u001b[49m\u001b[43m(\u001b[49m\u001b[43mzq\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mzq\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m 3\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mwaveform.shape:\u001b[39m\u001b[38;5;124m'\u001b[39m, waveform\u001b[38;5;241m.\u001b[39mshape)\n",
171
- "File \u001b[1;32mc:\\Users\\dslee\\anaconda3\\envs\\sound_effect_variation_generation\\lib\\site-packages\\torch\\utils\\_contextlib.py:116\u001b[0m, in \u001b[0;36mcontext_decorator.<locals>.decorate_context\u001b[1;34m(*args, **kwargs)\u001b[0m\n\u001b[0;32m 113\u001b[0m \u001b[38;5;129m@functools\u001b[39m\u001b[38;5;241m.\u001b[39mwraps(func)\n\u001b[0;32m 114\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mdecorate_context\u001b[39m(\u001b[38;5;241m*\u001b[39margs, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs):\n\u001b[0;32m 115\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m ctx_factory():\n\u001b[1;32m--> 116\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mfunc\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n",
172
- "File \u001b[1;32m~\\.cache\\huggingface\\modules\\transformers_modules\\hance-ai\\descript-audio-codec-16khz\\67523817a195ced323d12ce4c439590547d8e9c7\\model.py:159\u001b[0m, in \u001b[0;36mDAC.decode\u001b[1;34m(self, zq, s)\u001b[0m\n\u001b[0;32m 156\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39meval()\n\u001b[0;32m 158\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(zq,\u001b[38;5;28mtype\u001b[39m(\u001b[38;5;28;01mNone\u001b[39;00m)):\n\u001b[1;32m--> 159\u001b[0m waveform \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_chunk_decoding\u001b[49m\u001b[43m(\u001b[49m\u001b[43mzq\u001b[49m\u001b[43m)\u001b[49m \u001b[38;5;66;03m# (b, 1, length); output always has a mono-channel.\u001b[39;00m\n\u001b[0;32m 160\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(s,\u001b[38;5;28mtype\u001b[39m(\u001b[38;5;28;01mNone\u001b[39;00m)):\n\u001b[0;32m 161\u001b[0m zq \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mcode_to_zq(s)\n",
173
- "File \u001b[1;32m~\\.cache\\huggingface\\modules\\transformers_modules\\hance-ai\\descript-audio-codec-16khz\\67523817a195ced323d12ce4c439590547d8e9c7\\model.py:189\u001b[0m, in \u001b[0;36mDAC._chunk_decoding\u001b[1;34m(self, zq)\u001b[0m\n\u001b[0;32m 187\u001b[0m overlap_x_from_prev_x \u001b[38;5;241m=\u001b[39m waveform_concat[:,:,\u001b[38;5;241m-\u001b[39moverlap_size_in_data_space:] \u001b[38;5;66;03m# (b, 1, overlap_size_in_data_space)\u001b[39;00m\n\u001b[0;32m 188\u001b[0m overlap_x_from_new_x \u001b[38;5;241m=\u001b[39m waveform[:,:,:overlap_size_in_data_space] \u001b[38;5;66;03m# (b, 1, overlap_size_in_data_space)\u001b[39;00m\n\u001b[1;32m--> 189\u001b[0m overlap \u001b[38;5;241m=\u001b[39m (\u001b[43moverlap_x_from_prev_x\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m+\u001b[39;49m\u001b[43m \u001b[49m\u001b[43moverlap_x_from_new_x\u001b[49m) \u001b[38;5;241m/\u001b[39m \u001b[38;5;241m2\u001b[39m \u001b[38;5;66;03m# take mean; maybe there's a better strategy but it seems to work fine.\u001b[39;00m\n\u001b[0;32m 190\u001b[0m waveform_concat \u001b[38;5;241m=\u001b[39m torch\u001b[38;5;241m.\u001b[39mcat((prev_x, overlap, rest_of_new_x), dim\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m-\u001b[39m\u001b[38;5;241m1\u001b[39m) \u001b[38;5;66;03m# (b, 1, ..)\u001b[39;00m\n\u001b[0;32m 191\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n",
174
- "\u001b[1;31mRuntimeError\u001b[0m: The size of tensor a (1600) must match the size of tensor b (1592) at non-singleton dimension 2"
175
  ]
176
  }
177
  ],
 
161
  "metadata": {},
162
  "outputs": [
163
  {
164
+ "name": "stdout",
165
+ "output_type": "stream",
166
+ "text": [
167
+ "waveform.shape: torch.Size([1, 1, 159912])\n"
 
 
 
 
 
 
 
168
  ]
169
  }
170
  ],