Views
No views yet
model.safetensors plus a
small self-contained MLX implementation (rampart_mlx.py).nationaldesignstudio/rampart.
The original is distributed as a 4-bit quantized ONNX export; the float weights
here were recovered directly from that export (4-bit MatMulNBits linears and
INT8 embeddings dequantized to float) and then stored in MLX safetensors.O): GIVEN_NAME, SURNAME,
EMAIL, PHONE, URL, TAX_ID, BANK_ACCOUNT, ROUTING_NUMBER,
GOVERNMENT_ID, PASSPORT, DRIVERS_LICENSE, BUILDING_NUMBER, STREET_NAME,
SECONDARY_ADDRESS, CITY, STATE, ZIP_CODE.1pip install mlx tokenizers
2python demo.py "My name is John Smith, email john.smith@example.com"1import mlx.core as mx
2from tokenizers import Tokenizer
3from rampart_mlx import load
4
5model, cfg = load(".")
6tok = Tokenizer.from_file("tokenizer.json")
7enc = tok.encode("Call me at (555) 123-4567")
8logits = model(mx.array([enc.ids]), mx.array([enc.attention_mask]))
9label_ids = mx.argmax(logits[0], axis=-1).tolist()
10labels = [cfg.id2label[i] for i in label_ids]demo.py for BIO span decoding using the tokenizer's char offsets (needed to
map predicted labels back onto the original text for redaction).| File | Purpose |
|---|---|
model.safetensors | fp16 MLX weights (HuggingFace-style key names) |
config.json | model architecture + id2label |
rampart_mlx.py | self-contained MLX model + loader |
demo.py | tokenize → infer → decode spans |
tokenizer.json, vocab.txt, tokenizer_config.json, special_tokens_map.json | WordPiece tokenizer |
nationaldesignstudio/rampart (CC-BY-4.0)nreimers/MiniLM-L6-H384-uncasedai4privacy/pii-masking-openpii-1.5m (CC-BY-4.0)