Files
wehub-resource-sync 86db9aae8e
Documentation / build (push) Has been cancelled
Documentation / deploy (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:34:55 +08:00

25 lines
551 B
Python

""" Using ONNX classifier models - illustrates how to get started using
classifier encoding models with ONNX
`pip3 install onnxruntime`
"""
from llmware.models import ModelCatalog
# e.g., bias_detection models in catalog:
# "valurank-bias-onnx", "unitary-toxic-roberta-onnx"
# classifies the likelihood of a prompt injection
cl_name = "protectai-prompt-injection-onnx"
classifier_model = ModelCatalog().load_model(cl_name)
text = "Today is a beautiful day"
response = classifier_model.classify(text)
print("--response: ", response)