Heinrich Dinkel commited on
Commit
c123c63
·
1 Parent(s): d8212a1

deviec type autocast

Browse files
Files changed (1) hide show
  1. notebook.ipynb +2 -2
notebook.ipynb CHANGED
@@ -91,7 +91,7 @@
91
  " audio_tensor = torch.tensor(audio).float().unsqueeze(0).to(device)\n",
92
  " \n",
93
  " # Extract features\n",
94
- " with torch.no_grad():\n",
95
  " features = model.encode(audio_tensor)\n",
96
  " if isinstance(features, dict):\n",
97
  " for key in ['last_hidden_state', 'embeddings', 'audio']:\n",
@@ -271,4 +271,4 @@
271
  },
272
  "nbformat": 4,
273
  "nbformat_minor": 4
274
- }
 
91
  " audio_tensor = torch.tensor(audio).float().unsqueeze(0).to(device)\n",
92
  " \n",
93
  " # Extract features\n",
94
+ " with torch.no_grad(),torch.autocast(device_type='cuda'):\n",
95
  " features = model.encode(audio_tensor)\n",
96
  " if isinstance(features, dict):\n",
97
  " for key in ['last_hidden_state', 'embeddings', 'audio']:\n",
 
271
  },
272
  "nbformat": 4,
273
  "nbformat_minor": 4
274
+ }