Skip to content

Commit 03cd14c

Browse files
committed
peer reiview nits
1 parent 760b287 commit 03cd14c

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

modules/guardrails-configuring-the-hugging-face-detector-serving-runtime.adoc

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ ifdef::context[:parent-context: {context}]
99

1010
To use link:https://huggingface.co/docs/transformers/model_doc/auto#transformers.AutoModelForSequenceClassification[Hugging Face] `AutoModelsForSequenceClassification` as detectors within the Guardrails Orchestrator, you need to first configure a Hugging Face serving runtime.
1111

12-
The link:https://github.com/opendatahub-io/odh-model-controller/blob/incubating/config/runtimes/hf-detector-template.yaml[guardrails-detector-huggingface-runtime] is a KServe serving runtime for Hugging Face predictive text models. This
13-
allows models such as the link:https://huggingface.co/ibm-granite/granite-guardian-hap-38m[ibm-granite/granite-guardian-hap-38m] to be used within the TrustyAI Guardrails ecosystem.
12+
The link:https://github.com/opendatahub-io/odh-model-controller/blob/incubating/config/runtimes/hf-detector-template.yaml[guardrails-detector-huggingface-runtime] is a KServe serving runtime for Hugging Face predictive text models. This allows models such as the link:https://huggingface.co/ibm-granite/granite-guardian-hap-38m[ibm-granite/granite-guardian-hap-38m] to be used within the TrustyAI Guardrails ecosystem.
1413

1514
.Example custom serving runtime
1615

@@ -57,10 +56,8 @@ spec:
5756
- containerPort: 8000
5857
protocol: TCP
5958
----
60-
+
61-
The above serving runtime example matches the default template used with {productname-long}, and should suffice
62-
for the majority of use-cases. The main relevant configuration parameter is the `SAFE_LABELS` environment variable. This specifies which prediction label or labels from the `AutoModelForSequenceClassification` constitute a "safe" response and therefore should not trigger guardrailing. For example, if `[0, 1]` is specified as `SAFE_LABELS`
63-
for a four-class model, a predicted label of `0` or `1` is considered "safe", while a predicted label of `2` or `3` triggers guardrailing. The default value is `[0]`.
59+
60+
The above serving runtime example matches the default template used with {productname-long}, and should suffice for the majority of use-cases. The main relevant configuration parameter is the `SAFE_LABELS` environment variable. This specifies which prediction label or labels from the `AutoModelForSequenceClassification` constitute a "safe" response and therefore should not trigger guardrailing. For example, if `[0, 1]` is specified as `SAFE_LABELS` for a four-class model, a predicted label of `0` or `1` is considered "safe", while a predicted label of `2` or `3` triggers guardrailing. The default value is `[0]`.
6461

6562
== Guardrails Detector Hugging Face serving runtime configuration values
6663

modules/guardrails-orchestrator-detectors.adoc

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ The Guardrails framework provides a set of “built-in” detectors out-of-the-b
4848
`custom`::
4949
_Developer preview_
5050
* Custom detectors defined via a `custom_detectors.py` file.
51-
51+
+
5252
The detector algorithm can be chosen with `detector_params`, by first choosing the top-level taxonomy (e.g., `regex` or `file_type`) and then providing a list of the desired algorithms from within
53-
that category, for example:
53+
that category. In the following example, both the `credit-card` and `email` algorithms are run against the provided message:
5454

5555
[source,json]
5656
----
@@ -62,6 +62,4 @@ that category, for example:
6262
"regex": ["credit-card", "email"]
6363
}
6464
}
65-
----
66-
+
67-
In the above example, both the `credit-card` and `email` algorithms are run against the provided message.
65+
----

0 commit comments

Comments
 (0)