PhillNet_Recall / scripts /verify_release.py
ayjays132's picture
Upload 121 files
3b3b2bd verified
Raw History Blame Contribute Delete
704 Bytes
"""Verify the exact manifest, checkpoint reconstruction, and Python syntax."""
from pathlib import Path
import json,subprocess,sys,ast,importlib.util
ROOT=Path(__file__).resolve().parents[1]
spec=importlib.util.spec_from_file_location('publish_hf',ROOT/'scripts/publish_hf.py');module=importlib.util.module_from_spec(spec);spec.loader.exec_module(module)
paths=module.release_files(ROOT)
for path in paths:
if path.suffix=='.py':ast.parse(path.read_text(),filename=str(path))
subprocess.run([sys.executable,str(ROOT/'scripts/reproduce.py')],check=True,cwd=ROOT)
print(json.dumps({'manifest_files_verified':len(paths)-1,'python_syntax':'passed','checkpoint_reproduction':'passed','status':'passed'}))