Text Classification
Transformers
Safetensors
deberta-v2
agents
agent-safety
tool-use
prompt-injection
deberta-v3
text-embeddings-inference
Instructions to use kontext-security/Merlin with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use kontext-security/Merlin with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="kontext-security/Merlin")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("kontext-security/Merlin") model = AutoModelForSequenceClassification.from_pretrained("kontext-security/Merlin", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download v3-ungated/native/stepsafety/native_linear_generic.go from kontext-security/Merlin: direct link, hf CLI and curl.
- Browser
- Download file 690 Bytes
-
https://huggingface.co/kontext-security/Merlin/resolve/main/v3-ungated/native/stepsafety/native_linear_generic.go
- Command line
-
hf download hf://kontext-security/Merlin/v3-ungated/native/stepsafety/native_linear_generic.go
-
curl -L -o native_linear_generic.go https://huggingface.co/kontext-security/Merlin/resolve/main/v3-ungated/native/stepsafety/native_linear_generic.go
690 Bytes
| //go:build !arm64 || purego | |
| package stepsafety | |
| import ( | |
| "gonum.org/v1/gonum/blas" | |
| "gonum.org/v1/gonum/blas/gonum" | |
| ) | |
| func prepareNativeLinear(l nativeLinear) nativeLinear { return l } | |
| func prepareNativeLinearInto(l nativeLinear, _ []float32) nativeLinear { return l } | |
| func nativeLinearProduct(l nativeLinear, x []float32, rows int) []float32 { | |
| return nativeLinearProductInto(l, x, rows, nil) | |
| } | |
| func nativeLinearProductInto(l nativeLinear, x []float32, rows int, scratch []float32) []float32 { | |
| out := nativeBuffer(scratch, rows*l.out) | |
| gonum.Implementation{}.Sgemm(blas.NoTrans, blas.Trans, rows, l.out, l.in, 1, x, l.in, l.weight, l.in, 0, out, l.out) | |
| return out | |
| } | |