revise checkpoint.py