Skip to content

Commit

Permalink
Create mask on device
Browse files Browse the repository at this point in the history
  • Loading branch information
rlouf committed Jul 24, 2023
1 parent cfeb812 commit a9cd45b
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions outlines/text/generate/regex.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,7 @@ def create_proposal(
masks = []
for pstate in self.pstates:
mask = torch.full(
(len(self.model.tokenizer.vocabulary),),
-math.inf,
device=self.model.device,
(len(self.model.tokenizer.vocabulary),), -math.inf, device=self.device
)

if pstate[1] > -1:
Expand Down

0 comments on commit a9cd45b

Please sign in to comment.