Fix bos/eos token ids and regenerate model.pte
#2
by UncleanCode - opened
Companion to the main fix for huggingface/optimum-executorch#28.
Sets bos_token_id=1, eos_token_id=2 in config.json and generation_config.json, and regenerates model.pte from the corrected config so its get_bos_id/get_eos_id metadata match the tokenizer.
Verified with optimum-executorch main (44fa1d3), transformers 5.0.0rc1, executorch 1.3.1:
- current
executorchrevision:ValueError: The tokenizer's bos_token_id=1 must be the same as the model's bos_token_id=0. - this PR: model reports bos=1, eos=[2];
text_generationruns.
Export command: optimum-cli export executorch --model <fixed main> --task text-generation --recipe xnnpack. Note: the new model.pte is 4.2 MB vs 8.4 MB for the current one, likely different export defaults from when it was first made; happy to re-export with specific flags if you'd prefer.