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

Commit

Permalink
label vec to text vec (#3541)
Browse files Browse the repository at this point in the history
  • Loading branch information
Emily Dinan authored Mar 19, 2021
1 parent 1a3ffe0 commit 455a567
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion parlai/core/torch_generator_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -844,7 +844,7 @@ def rank_eval_label_candidates(self, batch, batchsize):
num_cands = len(batch.candidate_vecs[i])
enc = self.model.reorder_encoder_states(encoder_states, [i] * num_cands)
cands, _ = self._pad_tensor(batch.candidate_vecs[i])
cands = cands.to(batch.label_vec.device)
cands = cands.to(batch.text_vec.device)
scores, _ = self.model.decode_forced(enc, cands)
score_view = scores.reshape(num_cands * cands.size(1), -1)
cand_losses = F.cross_entropy(
Expand Down

0 comments on commit 455a567

Please sign in to comment.