Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

[Rerank] Ensure other batch fields are in re-ranker batch_act #4296

Merged
merged 1 commit into from
Jan 7, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions parlai/agents/reranker/reranker.py
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,7 @@ def batch_act(self, observations: List[Message]) -> List[Message]:
inference_batch_reply = super().batch_act(observations)
for i, resp in enumerate(inference_batch_reply):
beam_texts = batch_reply[i].get('beam_texts', [])
batch_reply[i] = resp # add metrics, other response items
new_beam_texts = [(*b, strategy) for b in resp.get('beam_texts', [])]
batch_reply[i].force_set('beam_texts', beam_texts + new_beam_texts)
# 2. Rerank
Expand Down