| language: en | |
| license: apache-2.0 | |
| tags: | |
| - secret-detection | |
| - onnx | |
| - int8 | |
| - cpu-optimized | |
| base_model: hypn05/secrets-sentinel | |
| # secrets-sentinel — CPU / ONNX INT8 | |
| ONNX INT8-quantized version of [hypn05/secrets-sentinel](https://huggingface.co/hypn05/secrets-sentinel). | |
| ~4× smaller, runs efficiently on CPU with <2% accuracy loss. | |
| ## Usage | |
| ```python | |
| from optimum.onnxruntime import ORTModelForSequenceClassification | |
| from transformers import AutoTokenizer | |
| tokenizer = AutoTokenizer.from_pretrained("hypn05/secrets-sentinel-cpu") | |
| model = ORTModelForSequenceClassification.from_pretrained("hypn05/secrets-sentinel-cpu") | |
| inputs = tokenizer(["export AWS_SECRET=abc123"], return_tensors="pt", truncation=True, max_length=128) | |
| outputs = model(**inputs) | |
| import torch | |
| probs = torch.softmax(outputs.logits, dim=1) | |
| print("Secret probability:", probs[0][1].item()) | |
| ``` | |
| ## Parent model | |
| See [hypn05/secrets-sentinel](https://huggingface.co/hypn05/secrets-sentinel) for the full PyTorch model and details. | |