-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathverify_artifact.py
More file actions
26 lines (20 loc) · 854 Bytes
/
Copy pathverify_artifact.py
File metadata and controls
26 lines (20 loc) · 854 Bytes
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
from __future__ import annotations
import argparse
import json
from pathlib import Path
from tensor_parallel_reference.verify import VerificationError, verify_artifact
def main() -> int:
parser = argparse.ArgumentParser()
parser.add_argument("artifact", type=Path)
parser.add_argument("--skip-source", action="store_true")
args = parser.parse_args()
try:
result = verify_artifact(args.artifact, check_source=not args.skip_source)
except (OSError, ValueError, KeyError, TypeError, VerificationError, json.JSONDecodeError) as exc:
print(f"Tensor Parallel Reference package verification: FAIL ({exc})")
return 1
print(json.dumps(result, sort_keys=True, indent=2))
print("Tensor Parallel Reference package verification: PASS")
return 0
if __name__ == "__main__":
raise SystemExit(main())