Download loader.py from STRICT-APT/strict-score-record: direct link, hf CLI and curl.
- Browser
- Download file 598 Bytes
-
https://huggingface.co/datasets/STRICT-APT/strict-score-record/resolve/main/loader.py
- Command line
-
hf download hf://datasets/STRICT-APT/strict-score-record/loader.py
-
curl -L -o loader.py https://huggingface.co/datasets/STRICT-APT/strict-score-record/resolve/main/loader.py
598 Bytes
| """Minimal reader for one score file of the STRICT record (a PIDSMaker evaluation output written by torch.save, | |
| despite its .pkl name). Needs PyTorch; weights_only=False because the file holds Python objects, so load only files whose | |
| hash matches a manifest.""" | |
| import sys, torch | |
| d = torch.load(sys.argv[1], map_location="cpu", weights_only=False) | |
| print({k: (getattr(v, "shape", None) or (len(v) if hasattr(v, "__len__") else v)) for k, v in d.items()}) | |
| # keys: pred_scores (per node), y_preds (alert at the native threshold), y_truth (label), nodes (node ids), node2attacks (node -> campaign ids) | |