Token Classification
Transformers
Safetensors
English
beam
mixture-of-experts
safety
content-moderation
Instructions to use reflection/Iris-Content-Guard with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use reflection/Iris-Content-Guard with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="reflection/Iris-Content-Guard")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForTokenClassification tokenizer = AutoTokenizer.from_pretrained("reflection/Iris-Content-Guard") model = AutoModelForTokenClassification.from_pretrained("reflection/Iris-Content-Guard", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download chat_template.jinja from reflection/Iris-Content-Guard: direct link, hf CLI and curl.
- Browser
- Download file 617 Bytes
-
https://huggingface.co/reflection/Iris-Content-Guard/resolve/main/chat_template.jinja
- Command line
-
hf download hf://reflection/Iris-Content-Guard/chat_template.jinja
-
curl -L -o chat_template.jinja https://huggingface.co/reflection/Iris-Content-Guard/resolve/main/chat_template.jinja
617 Bytes
| {%- for message in messages -%} | |
| {%- if message['content'] is not string -%} | |
| {{- raise_exception('Iris Content Guard requires string content') -}} | |
| {%- elif message['role'] == 'user' -%} | |
| {{- '<|start|>user<|message|>' + message['content'] + '<|end|>' -}} | |
| {%- elif message['role'] == 'assistant' and not message.get('tool_calls') -%} | |
| {{- '<|start|>assistant<|channel|>analysis<|message|><|end|>' -}} | |
| {{- '<|start|>assistant<|channel|>final<|message|>' + message['content'] + '<|return|>' -}} | |
| {%- else -%} | |
| {{- raise_exception('Iris Content Guard supports plain user and assistant turns') -}} | |
| {%- endif -%} | |
| {%- endfor -%} | |