File size: 1,328 Bytes
1d7c7c4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env python3
"""Static safety gate for the final merged-model vision evaluation."""

from pathlib import Path


ROOT = Path(__file__).resolve().parents[2]


def main() -> None:
    launcher = (ROOT / "scripts" / "phase6_run_final_vision_eval.sh").read_text()
    for invariant in (
        "verify_hf_device_map.py",
        "bind_vision_eval_run.py",
        "--no_remove_unused_columns",
        "--require-complete",
        "compare_vision_evals.py",
        "DSV4VL_FINAL_VISION_SEMANTIC_SMOKE=PASS",
        "DSV4VL_FINAL_VISION_EVAL_AND_IMPROVEMENT=PASS",
        "DSV4VL_VISION_EVAL_COST_APPROVED",
        "DSV4VL_VISION_EVAL_AUTO_COST_LIMIT",
        "calculate_vision_eval_cost.py",
        "quantization_config",
        "num_nextn_predict_layers",
    ):
        assert invariant in launcher
    assert "--per-suite 16" in launcher
    assert "--write_batch_size \"$write_batch\"" in launcher
    assert "cmp -s \"$MODEL/modeling_dsv4_vl.py\"" in launcher
    assert launcher.index("DSV4VL_FINAL_VISION_SEMANTIC_SMOKE=PASS") < launcher.index(
        "DSV4VL_VISION_EVAL_COST_APPROVED"
    )
    assert launcher.index("DSV4VL_VISION_EVAL_COST_APPROVED") < launcher.index(
        'run_pending "$FULL_RESULT"'
    )
    print("DSV4VL_FINAL_VISION_EVAL_SCRIPT=PASS")


if __name__ == "__main__":
    main()