Skip to content

Commit

Permalink
Fix #196 (#201)
Browse files Browse the repository at this point in the history
  • Loading branch information
igor-pechersky authored Jan 17, 2024
1 parent f97900c commit 4916b2c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion keybert/_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,9 @@ def extract_keywords(
# Fine-tune keywords using an LLM
if self.llm is not None:
import torch
doc_embeddings = torch.from_numpy(doc_embeddings).float().to("cuda")
doc_embeddings = torch.from_numpy(doc_embeddings).float()
if torch.cuda.is_available():
doc_embeddings = doc_embeddings.to("cuda")
if isinstance(all_keywords[0], tuple):
candidate_keywords = [[keyword[0] for keyword in all_keywords]]
else:
Expand Down

0 comments on commit 4916b2c

Please sign in to comment.