Views
No views yet
safetensors (Optimized for secure, CPU-bound inference).transformers auto-classes. You must load the weights into your custom PyTorch class.1from huggingface_hub import hf_hub_download
2from safetensors.torch import load_file
3import torch
4
5# 1. Download the weights securely
6model_path = hf_hub_download(
7 repo_id="nisarg6502/Llama3-150M-PII-Redactor",
8 filename="pii_model_epoch_3.safetensors"
9)
10
11# 2. Load into your custom GPT PyTorch class
12device = torch.device("cpu")
13state_dict = load_file(model_path, device=str(device))
14
15# model = GPT(config) # (Instantiate your custom class here)
16model.load_state_dict(state_dict)
17model.eval()ai4privacy/pii-masking-200k dataset.