Why change prompt_token_ids depending on encoder_decoder
meanwo opened this issue · comments
meanwo commented
if self.model.config.is_encoder_decoder:
max_src_len = context_length
else:
max_src_len = context_length - max_new_tokens - 1
prompt_token_ids = prompt_token_ids[-max_src_len:]
When using the only decoder-based model(llama2) on the hugging face, the prompt_token_ids(input_token_ids) length never changed because of max_new_tokens.
Is there a reason why you set promt_token_ids to change based on max_new_tokens via else syntax??