Skip to content

Commit

Permalink
fix: rare device mismatch
Browse files Browse the repository at this point in the history
  • Loading branch information
bclavie committed Feb 23, 2024
1 parent bfd0d57 commit 4db672e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions ragatouille/models/colbert.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from colbert import Indexer, IndexUpdater, Searcher, Trainer
from colbert.infra import ColBERTConfig, Run, RunConfig
from colbert.modeling.checkpoint import Checkpoint

from ragatouille.models.base import LateInteractionModel

# TODO: Move all bsize related calcs to `_set_bsize()`
Expand Down Expand Up @@ -751,7 +750,7 @@ def encode(
- encodings.shape[1],
encodings.shape[2],
)
),
).to(device=encodings.device),
],
dim=1,
)
Expand All @@ -765,7 +764,7 @@ def encode(
- doc_masks.shape[1],
),
-float("inf"),
),
).to(device=encodings.device),
],
dim=1,
)
Expand Down

0 comments on commit 4db672e

Please sign in to comment.