Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

Move input to biencoder to the same device #90

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions blink/main_dense.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ def _run_biencoder(biencoder, dataloader, candidate_encoding, top_k=100, indexer
all_scores = []
for batch in tqdm(dataloader):
context_input, _, label_ids = batch
context_input = context_input.to(device=biencoder.device)
with torch.no_grad():
if indexer is not None:
context_encoding = biencoder.encode_context(context_input).numpy()
Expand Down