Text Classification
Transformers
Safetensors
English
deberta-v2
secret-detection
secrets
security
cybersecurity
devsecops
sast
code-security
code-analysis
supply-chain-security
pre-commit
ci-cd
github-actions
password-detection
api-key-detection
token-detection
credential-detection
secure-coding
deberta
deberta-v3
binary-classification
Eval Results (legacy)
text-embeddings-inference
Instructions to use hypn05/secrets-sentinel with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use hypn05/secrets-sentinel with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="hypn05/secrets-sentinel")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("hypn05/secrets-sentinel") model = AutoModelForSequenceClassification.from_pretrained("hypn05/secrets-sentinel", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Added transformer example
Browse files46 unmodified lines47484950515246 unmodified linesclassifier("+ password='secret123'")```### Intended UseProduction secret detection in git diffs.46 unmodified lines47484950515253545556575859606162636465666768697071727374757677787980818283848546 unmodified linesclassifier("+ password='secret123'")``````python# Load model directlyfrom transformers import AutoTokenizer, AutoModelForSequenceClassificationtokenizer = AutoTokenizer.from_pretrained("hypn05/secret-detector-deberta-base")model = AutoModelForSequenceClassification.from_pretrained("hypn05/secret-detector-deberta-base")# List of examples: some that represent sensitive tokens and others that are standard textexamples = ["password='secret123'", # Represents a secret"print('Hello, world!')", # Not a secret"ACCESS_TOKEN_REDACTED_VALUE", # Not a secret"def calculate_sum(a, b): return a + b", # Not a secret"DATABASE_CONNECTION_STRING_PLACEHOLDER", # Not a secret"The weather is nice today." # Not a secret]import torch# Run inference on the listfor text in examples:inputs = tokenizer(text, return_tensors="pt")with torch.no_grad():outputs = model(**inputs)logits = outputs.logits# Get prediction and map to human-readable labelpredicted_class_id = logits.argmax().item()label = model.config.id2label[predicted_class_id]print(f"[{label}] -> {text}")```### Intended UseProduction secret detection in git diffs.
README.md+33