Skip to content

Commit

Permalink
move model to device.
Browse files Browse the repository at this point in the history
  • Loading branch information
shibing624 committed Sep 20, 2023
1 parent abb6a07 commit 4eff700
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions text2vec/sentence_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,8 @@ def encode(
self.bert.eval()
if device is None:
device = self.device
self.bert.to(device)

if max_seq_length is None:
max_seq_length = self.max_seq_length
if convert_to_tensor:
Expand Down

0 comments on commit 4eff700

Please sign in to comment.