Skip to content

Commit

Permalink
fix missing return dict (#8653)
Browse files Browse the repository at this point in the history
  • Loading branch information
lhoestq authored Nov 19, 2020
1 parent 0c2677f commit 62cd9ce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/rag/use_own_knowledge_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def embed(documents: dict, ctx_encoder: DPRContextEncoder, ctx_tokenizer: DPRCon
input_ids = ctx_tokenizer(
documents["title"], documents["text"], truncation=True, padding="longest", return_tensors="pt"
)["input_ids"]
embeddings = ctx_encoder(input_ids.to(device=device)).pooler_output
embeddings = ctx_encoder(input_ids.to(device=device), return_dict=True).pooler_output
return {"embeddings": embeddings.detach().cpu().numpy()}


Expand Down

0 comments on commit 62cd9ce

Please sign in to comment.