espnet2.speechlm.bin.train.record_token_layout
espnet2.speechlm.bin.train.record_token_layout
espnet2.speechlm.bin.train.record_token_layout(config_path: Path, intervals: dict) → None
Write this run’s token layout into the saved config.
Token ids follow the order of multimodal_io, so a config re-saved with its keys sorted gives a different layout while the checkpoint still loads: the model decodes nothing recognisable and nothing says why. Recording the layout lets the job template catch that on load.
sort_keys=False is the point of this function as much as the record is: dumping with the default would itself sort multimodal_io and move every id, which is the failure this guard exists to catch. Re-dumping does lose the comments and the formatting of the copy, which is why it rewrites the copy in the output directory and never the config the user passed in.
A run that resumes finds the record already there and leaves it alone, so the layout of the first run is the one that is checked.
