Skip to content

Commit 9c1cc42

Browse files
committed
fix(test): match the current scan_layers mismatch error
The restore path now reports an unmatched checkpoint with 'Checkpoint does not match the model', listing each weight the checkpoint didn't carry. The test still expected the older wording. 'Failed to restore checkpoint' is not raised anywhere, and 'Configuration mismatch' comes from the load_parameters_path metadata check, which this test doesn't exercise. Also assert the missing per-layer weight path, so the check is tied to the scan/unscan mismatch rather than the generic hint line, which any architecture mismatch would print.
1 parent 7ab7732 commit 9c1cc42

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

tests/integration/checkpointing_test.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,5 +228,9 @@ def get_cmd(steps, metrics_file):
228228
with pytest.raises(ValueError) as excinfo:
229229
train_main(mismatch_command)
230230

231-
assert "Configuration mismatch" in str(excinfo.value) or "Failed to restore checkpoint" in str(excinfo.value)
232-
assert "scan_layers" in str(excinfo.value)
231+
# The scanned checkpoint doesn't carry the unscanned model's per-layer weights, so the restore
232+
# reports them as missing rather than leaving them at their init values.
233+
message = str(excinfo.value)
234+
assert "Checkpoint does not match the model" in message
235+
assert "decoder/layers/0/" in message
236+
assert "scan_layers" in message

0 commit comments

Comments
 (0)