Skip to content

Commit

Permalink
added gpu to extreme classification
Browse files Browse the repository at this point in the history
  • Loading branch information
jamescalam committed Jan 22, 2023
1 parent a0bc230 commit 37f62b2
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -388,9 +388,15 @@
],
"source": [
"from sentence_transformers import SentenceTransformer\n",
"import torch\n",
"\n",
"device = 'cuda' if torch.cuda.is_available() else 'cpu'\n",
"\n",
"# load the model from huggingface\n",
"model = SentenceTransformer('sentence-transformers/all-MiniLM-L6-v2')\n",
"model = SentenceTransformer(\n",
" 'sentence-transformers/all-MiniLM-L6-v2',\n",
" device=device\n",
")\n",
"model"
]
},
Expand Down

0 comments on commit 37f62b2

Please sign in to comment.