ydshieh commited on
Commit
e00ec09
·
1 Parent(s): 49030fb
run_image_captioning_flax_reduced.py CHANGED
@@ -504,7 +504,9 @@ def main():
504
  "Decoder Config: Either a pretrained config or a model location for decoder is required."
505
  )
506
 
507
- # GPT2 only has eos token but not pad token
 
 
508
  if decoder_config.pad_token_id is None:
509
  decoder_config.pad_token_id = decoder_config.eos_token_id
510
 
 
504
  "Decoder Config: Either a pretrained config or a model location for decoder is required."
505
  )
506
 
507
+ # GPT2 only has bos/eos token but not decoder_start/pad token
508
+ if decoder_config.decoder_start_token_id is None:
509
+ decoder_config.decoder_start_token_id = decoder_config.bos_token_id
510
  if decoder_config.pad_token_id is None:
511
  decoder_config.pad_token_id = decoder_config.eos_token_id
512