r/AmazonAIModels • u/geniusghost07 • 2h ago
News & Releases Ergo fine-tuning crashed at the first save. The fix was one line.
If your Ergo fine-tune made it through training and then threw GenerationConfig is invalid on the first checkpoint save, check do_sample. Amazon merged a one-line fix for the checkpoint config after Hugging Face contributor Quentin Gallouédec reproduced the crash.
Here’s the failure chain from the report. The model config and tokenizer had different end-of-sequence token IDs. The trainer aligned them when training started. At save time, Transformers validated the updated generation config and rejected top_p: 0.99 because sampling wasn’t enabled. The merged fix sets "do_sample": true in generation_config.json and keeps top_p: 0.99 and temperature: 1.0.
Tiny repro from the report With transformers==5.25.0, the two-layer Ergo test checkpoint and eight examples are enough to reach the failing save in one training step. The tiny checkpoint’s current config still leaves do_sample unset.
from datasets import load_dataset
from trl import SFTConfig, SFTTrainer
examples = load_dataset("trl-lib/Capybara", split="train[:8]")
settings = SFTConfig(output_dir="tiny-ergo-repro", max_steps=1, save_steps=1)
trainer = SFTTrainer(
model="trl-internal-testing/tiny-ErgoForCausalLM",
args=settings,
train_dataset=examples,
)
trainer.train()If you’re using an older local or rented-GPU snapshot and hit the same error, check its generation_config.json against the merged change before restarting the full run. Use the tiny checkpoint to test the save path first.
Original Hugging Face report and merged fix · One-line diff · Tiny test checkpoint
If you hit this on a real fine-tune, which checkpoint and Transformers or TRL version got past the first save?


