Files
llmware-ai--llmware/solutions/openvino/using_openvino_classifier_model.py
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

26 lines
624 B
Python

""" Using OpenVINO classifier-based models - illustrates how to get started using
classifier encoding models with OpenVINO."
`pip3 install openvino`
"""
from llmware.models import ModelCatalog
# classifies the likelihood of a prompt injection
cl_name = "protectai-prompt-injection-ov"
# e.g., other examples:
# -- "unitary-toxic-roberta-ov" - classifies potential toxicity
# -- "valurank-bias-ov" - classifies potential bias
classifier_model = ModelCatalog().load_model(cl_name)
text = "The sun is shining in New York today."
response = classifier_model.classify(text)
print("--response: ", response)