Heinrich Dinkel commited on
Commit ·
ddcfc9a
1
Parent(s): cbb8813
autocast to fp16
Browse files- notebook.ipynb +1 -1
notebook.ipynb
CHANGED
|
@@ -187,7 +187,7 @@
|
|
| 187 |
" batch_labels = batch_labels.to(device)\n",
|
| 188 |
"\n",
|
| 189 |
" # Forward through frozen model\n",
|
| 190 |
-
" with torch.no_grad():\n",
|
| 191 |
" features = model.encode(batch_audio)\n",
|
| 192 |
" if isinstance(features, dict):\n",
|
| 193 |
" for key in ['last_hidden_state', 'embeddings', 'audio']:\n",
|
|
|
|
| 187 |
" batch_labels = batch_labels.to(device)\n",
|
| 188 |
"\n",
|
| 189 |
" # Forward through frozen model\n",
|
| 190 |
+
" with torch.no_grad(), torch.autocast(device_type='cuda'):\n",
|
| 191 |
" features = model.encode(batch_audio)\n",
|
| 192 |
" if isinstance(features, dict):\n",
|
| 193 |
" for key in ['last_hidden_state', 'embeddings', 'audio']:\n",
|