Skip to content

Commit

Permalink
fix replace_bos_with_pad not found (#6443)
Browse files Browse the repository at this point in the history
Signed-off-by: Abhinav Khattar <[email protected]>
  • Loading branch information
aklife97 authored and web-flow committed Apr 19, 2023
1 parent 499a3b2 commit c519c3c
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 c519c3c

Please sign in to comment.