ai4privacy/pii-masking-200k
Viewer • Updated • 209k • 2.93k • 125
This is a custom 150-million parameter autoregressive language model built entirely from scratch in PyTorch. It has been modernized with Llama-3 architectural features and fine-tuned specifically to act as a local Personally Identifiable Information (PII) redaction microservice.
safetensors (Optimized for secure, CPU-bound inference).This model is designed to intercept and scrub sensitive entities (names, emails, phone numbers, addresses, etc.) from raw text before the data is transmitted to external cloud services (like OpenAI or Anthropic). It acts as a highly constrained, local privacy firewall.
Because this is a custom architecture, it does not use the standard transformers auto-classes. You must load the weights into your custom PyTorch class.
from huggingface_hub import hf_hub_download
from safetensors.torch import load_file
import torch
# 1. Download the weights securely
model_path = hf_hub_download(
repo_id="nisarg6502/Llama3-150M-PII-Redactor",
filename="pii_model_epoch_3.safetensors"
)
# 2. Load into your custom GPT PyTorch class
device = torch.device("cpu")
state_dict = load_file(model_path, device=str(device))
# model = GPT(config) # (Instantiate your custom class here)
model.load_state_dict(state_dict)
model.eval()
ai4privacy/pii-masking-200k dataset.