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 config.json from reflection/Iris-Content-Guard: direct link, hf CLI and curl.
- Browser
- Download file 3.84 kB
-
https://huggingface.co/reflection/Iris-Content-Guard/resolve/main/config.json
- Command line
-
hf download hf://reflection/Iris-Content-Guard/config.json
-
curl -L -o config.json https://huggingface.co/reflection/Iris-Content-Guard/resolve/main/config.json
3.84 kB
| { | |
| "dtype": "bfloat16", | |
| "head_dtype": "bfloat16", | |
| "io_processor_plugin": "iris_content_guard", | |
| "label2id": { | |
| "request/cyber": 0, | |
| "request/fraud": 1, | |
| "request/privacy": 2, | |
| "request/bio_weapons": 3, | |
| "request/chem_weapons": 4, | |
| "request/rn_weapons": 5, | |
| "request/child_safety_non_csae": 6, | |
| "request/violence": 7, | |
| "request/self_harm": 8, | |
| "request/grooming": 9, | |
| "request/sex_crimes": 10, | |
| "request/sex_content": 11, | |
| "request/illegal_activities": 12, | |
| "request/hate": 13, | |
| "response/cyber": 14, | |
| "response/fraud": 15, | |
| "response/privacy": 16, | |
| "response/bio_weapons": 17, | |
| "response/chem_weapons": 18, | |
| "response/rn_weapons": 19, | |
| "response/child_safety_non_csae": 20, | |
| "response/violence": 21, | |
| "response/self_harm": 22, | |
| "response/grooming": 23, | |
| "response/sex_crimes": 24, | |
| "response/sex_content": 25, | |
| "response/illegal_activities": 26, | |
| "response/hate": 27 | |
| }, | |
| "problem_type": "multi_label_classification", | |
| "custom_pipelines": { | |
| "token-classification": { | |
| "impl": "pipeline.IrisContentGuardPipeline", | |
| "pt": [ | |
| "AutoModelForTokenClassification" | |
| ] | |
| } | |
| }, | |
| "architectures": [ | |
| "BeamForTokenClassification" | |
| ], | |
| "num_labels": 28, | |
| "id2label": { | |
| "0": "request/cyber", | |
| "1": "request/fraud", | |
| "2": "request/privacy", | |
| "3": "request/bio_weapons", | |
| "4": "request/chem_weapons", | |
| "5": "request/rn_weapons", | |
| "6": "request/child_safety_non_csae", | |
| "7": "request/violence", | |
| "8": "request/self_harm", | |
| "9": "request/grooming", | |
| "10": "request/sex_crimes", | |
| "11": "request/sex_content", | |
| "12": "request/illegal_activities", | |
| "13": "request/hate", | |
| "14": "response/cyber", | |
| "15": "response/fraud", | |
| "16": "response/privacy", | |
| "17": "response/bio_weapons", | |
| "18": "response/chem_weapons", | |
| "19": "response/rn_weapons", | |
| "20": "response/child_safety_non_csae", | |
| "21": "response/violence", | |
| "22": "response/self_harm", | |
| "23": "response/grooming", | |
| "24": "response/sex_crimes", | |
| "25": "response/sex_content", | |
| "26": "response/illegal_activities", | |
| "27": "response/hate" | |
| }, | |
| "vocab_size": 151936, | |
| "hidden_size": 3072, | |
| "intermediate_size": 12288, | |
| "num_hidden_layers": 18, | |
| "num_attention_heads": 32, | |
| "num_key_value_heads": 4, | |
| "hidden_act": "silu", | |
| "max_position_embeddings": 131072, | |
| "initializer_range": 0.02, | |
| "rms_norm_eps": 1e-06, | |
| "use_cache": true, | |
| "tie_word_embeddings": false, | |
| "rope_parameters": { | |
| "sliding_attention": { | |
| "rope_type": "default", | |
| "rope_theta": 10000.0 | |
| }, | |
| "full_attention": null | |
| }, | |
| "attention_bias": false, | |
| "sliding_window": 512, | |
| "attention_dropout": 0.0, | |
| "moe_intermediate_size": 1536, | |
| "num_experts_per_tok": 8, | |
| "num_experts": 128, | |
| "norm_topk_prob": true, | |
| "output_router_logits": false, | |
| "pad_token_id": null, | |
| "bos_token_id": null, | |
| "eos_token_id": null, | |
| "head_dim": 128, | |
| "layer_types": [ | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "full_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "full_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "sliding_attention", | |
| "full_attention" | |
| ], | |
| "mlp_layer_types": [ | |
| "dense", | |
| "dense", | |
| "dense", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse", | |
| "sparse" | |
| ], | |
| "n_group": 8, | |
| "topk_group": 4, | |
| "routed_scaling_factor": 2.5, | |
| "final_logit_softcapping": null, | |
| "model_type": "beam" | |
| } | |