Skip to content
Open
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
2 changes: 1 addition & 1 deletion mGPT/archs/lm_multihead.py
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ def generate(
idx_next_rhand = torch.argmax(probs_rhand, dim=1, keepdim=True)
idx_next_lhand[finished] = idx_next_rhand[finished] = self.eos_idx

finished = torch.any(idx_next_body.squeeze(-1) == self.eos_idx, dim=-1)
finished = finished | (idx_next_body.squeeze(-1) == self.eos_idx)

# append sampled index to the running sequence and continue
decoder_input_ids = torch.cat((decoder_input_ids, idx_next_body), dim=1)
Expand Down