Skip to content

Commit a9cd45b

Browse files
committed
Create mask on device
1 parent cfeb812 commit a9cd45b

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

outlines/text/generate/regex.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,7 @@ def create_proposal(
128128
masks = []
129129
for pstate in self.pstates:
130130
mask = torch.full(
131-
(len(self.model.tokenizer.vocabulary),),
132-
-math.inf,
133-
device=self.model.device,
131+
(len(self.model.tokenizer.vocabulary),), -math.inf, device=self.device
134132
)
135133

136134
if pstate[1] > -1:

0 commit comments

Comments
 (0)