File size: 704 Bytes
3b3b2bd
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
"""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'}))