Skip to content

Commit

Permalink
fix replace_bos_with_pad not found (NVIDIA#6443) (NVIDIA#6450)
Browse files Browse the repository at this point in the history
Signed-off-by: Abhinav Khattar <[email protected]>
Co-authored-by: Abhinav Khattar <[email protected]>
Signed-off-by: hsiehjackson <[email protected]>
  • Loading branch information
2 people authored and hsiehjackson committed Jun 2, 2023
1 parent 3f1bbc7 commit 72d993f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ def inference_step(self, dataloader_iter, batch_idx: int, mode: str, dataloader_
tokens_enc=batch['text_enc'],
enc_mask=batch['enc_mask'],
num_tokens_to_generate=30,
bos_id=self.tokenizer.pad_id if data_cfg.replace_bos_with_pad else self.tokenizer.bos_id,
bos_id=self.tokenizer.pad_id if data_cfg.get('replace_bos_with_pad', False) else self.tokenizer.bos_id,
)

# Special ids to text function to handle stripping <eos> and special tokens with sentencepiece tokenizers.
Expand Down

0 comments on commit 72d993f

Please sign in to comment.