Skip to content

Commit

Permalink
Fix pad token id in ONNX Runtime GenAI config
Browse files Browse the repository at this point in the history
  • Loading branch information
kunal-vaishnavi authored May 3, 2024
1 parent 42bd715 commit d7f95a1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/python/py/models/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def make_genai_config(self, model_name_or_path, extra_kwargs, out_dir):
"num_key_value_heads": self.num_kv_heads,
},
"eos_token_id": config.eos_token_id,
"pad_token_id": config.pad_token_id if hasattr(config, "pad_token_id") and config.pad_token_id is not None else config.eos_token_id,
"pad_token_id": config.pad_token_id if hasattr(config, "pad_token_id") and config.pad_token_id is not None else config.eos_token_id[0] if type(config.eos_token_id) == list else config.eos_token_id,
"type": self.model_type[ : self.model_type.find("For")].lower(),
"vocab_size": self.vocab_size,
},
Expand Down

0 comments on commit d7f95a1

Please sign in to comment.