Skip to content

Commit 13b00ff

Browse files
Bugfix: make sure all tensors are on the same device.
1 parent 26ed766 commit 13b00ff

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

validator/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def _embed(self, prompts: list[str]):
104104
truncation=True,
105105
return_tensors='pt',
106106
max_length=512, # This may be too small to adequately capture the info.
107-
)
107+
).to(self.device)
108108
with torch.no_grad():
109109
model_outputs = self.embedding_model(**encoded_input)
110110
embeddings = DetectJailbreak._mean_pool(

0 commit comments

Comments
 (0)