Views
No views yet
sentinel-01-pub-ths is a TorchScript packaging of the public sentinel-01-pub Aurelex Sentinel Stage A artifact. It is provided for users who want to avoid Hugging Face remote custom Python code while evaluating the same limited-functionality wealth-management communications risk model.AurelexAI/sentinel-01-pub-thsAurelexAI/sentinel-01-pubsentinel-mb-c-d11sentinel-mb-c-d11-20260424sentinel-01-pub-thsanswerdotai/ModernBERT-basetorchscript_graphAurelexAI/sentinel-01-pub. The source encoder lineage is listed for transparency and Hugging Face discoverability; users do not need to load a separate encoder.pip install torch transformers huggingface_hub1import json
2import torch
3from huggingface_hub import hf_hub_download
4from transformers import AutoTokenizer
5
6REPO_ID = "AurelexAI/sentinel-01-pub-ths"
7
8model_path = hf_hub_download(REPO_ID, "model.torchscript.pt")
9schema_path = hf_hub_download(REPO_ID, "sentinel_schema.json")
10
11with open(schema_path, "r", encoding="utf-8") as handle:
12 schema = json.load(handle)
13
14tokenizer = AutoTokenizer.from_pretrained(REPO_ID, trust_remote_code=False)
15model = torch.jit.load(model_path, map_location="cpu")
16model.eval()
17
18text = (
19 "Subject: Portfolio review follow-up. Hi Karen, following our quarterly "
20 "review, I recommend trimming part of the concentrated technology position "
21 "and reallocating the proceeds into the municipal bond ladder we discussed."
22)
23
24inputs = tokenizer(
25 text,
26 return_tensors="pt",
27 truncation=True,
28 max_length=schema.get("max_length", 512),
29)
30
31with torch.no_grad():
32 raw_outputs = model(inputs["input_ids"], inputs["attention_mask"])
33
34logits = dict(zip(schema["output_order"], raw_outputs))1def decode_head(name, values):
2 spec = schema["output_signature"][name]
3 kind = spec["type"]
4
5 if kind == "binary":
6 probability = float(torch.sigmoid(values)[0])
7 threshold = schema["thresholds"].get(name, 0.5)
8 return {
9 "label": probability >= threshold,
10 "probability": probability,
11 "threshold": threshold,
12 }
13
14 if kind == "multiclass":
15 labels = spec["labels"]
16 probabilities = torch.softmax(values, dim=-1)[0]
17 index = int(torch.argmax(probabilities))
18 return {
19 "label": labels[index],
20 "probability": float(probabilities[index]),
21 "probabilities": {
22 label: float(probabilities[position])
23 for position, label in enumerate(labels)
24 },
25 }
26
27 if kind == "multilabel":
28 labels = spec["labels"]
29 probabilities = torch.sigmoid(values)[0]
30 threshold = schema["thresholds"].get(name, 0.5)
31 return {
32 "labels": [
33 label
34 for position, label in enumerate(labels)
35 if float(probabilities[position]) >= threshold
36 ],
37 "threshold": threshold,
38 "probabilities": {
39 label: float(probabilities[position])
40 for position, label in enumerate(labels)
41 },
42 }
43
44 raise ValueError(f"unsupported output head type: {kind}")
45
46
47result = {
48 name: decode_head(name, values)
49 for name, values in logits.items()
50}
51
52print(result)
53print(schema["model_version"])trust_remote_code=False, and the model graph is loaded explicitly with torch.jit.load.sentinel-01-pub Sentinel Stage A contract: violation, severity, domain, subtype, jurisdiction, why, impacted_principles, remediation_actions, content_type, audience_segment, detection_difficulty, and aggravating_factors.2026-04-07-final-audit-clear-v1, test split size 150.| Metric | Test |
|---|---|
| Stage-A | 0.751 |
| Violation F1 | 0.993 |
| Severity Acc | 0.727 |
| Domain F1 | 0.803 |
| Subtype F1 | 0.738 |
| Jurisdiction Acc | 0.740 |
| Why F1 | 0.684 |
| Principles F1 | 0.703 |
| Remediation F1 | 0.618 |
| Aggravating F1 | 0.655 |
model.torchscript.pt: TorchScript graph artifact containing the public end-to-end model.sentinel_schema.json: output head order, label schema, thresholds, model version, and runtime metadata.metadata.json: dataset signature, output signature, thresholds, and release metadata.metrics.json: evaluation metrics for the selected model.results.md: human-readable evaluation artifact.checksums.sha256: SHA-256 checksums for the published graph package files.