Text Classification
PEFT
Safetensors
qwen3
moderation
toxicity
jailbreak-detection
multi-label
encoder-conversion
Instructions to use opus-research/opus-moderation-3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use opus-research/opus-moderation-3 with PEFT:
from peft import PeftModel from transformers import AutoModelForSequenceClassification base_model = AutoModelForSequenceClassification.from_pretrained("Qwen/Qwen3-1.7B") model = PeftModel.from_pretrained(base_model, "opus-research/opus-moderation-3") - Notebooks
- Google Colab
- Kaggle
| { | |
| "architectures": [ | |
| "Qwen3ForCausalLM" | |
| ], | |
| "attention_bias": false, | |
| "attention_dropout": 0.0, | |
| "bos_token_id": null, | |
| "dtype": "bfloat16", | |
| "eos_token_id": 151645, | |
| "head_dim": 128, | |
| "hidden_act": "silu", | |
| "hidden_size": 2048, | |
| "id2label": { | |
| "0": "toxicity", | |
| "1": "severe_toxicity", | |
| "2": "obscene", | |
| "3": "threat", | |
| "4": "insult", | |
| "5": "identity_attack", | |
| "6": "sexual_explicit", | |
| "7": "jailbreaking" | |
| }, | |
| "initializer_range": 0.02, | |
| "intermediate_size": 6144, | |
| "label2id": { | |
| "identity_attack": 5, | |
| "insult": 4, | |
| "jailbreaking": 7, | |
| "obscene": 2, | |
| "severe_toxicity": 1, | |
| "sexual_explicit": 6, | |
| "threat": 3, | |
| "toxicity": 0 | |
| }, | |
| "layer_types": [ | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention" | |
| ], | |
| "max_position_embeddings": 40960, | |
| "max_window_layers": 28, | |
| "model_type": "qwen3", | |
| "num_attention_heads": 16, | |
| "num_hidden_layers": 28, | |
| "num_key_value_heads": 8, | |
| "opus_arch": { | |
| "base_model": "Qwen/Qwen3-1.7B", | |
| "bidirectional": true, | |
| "kept_layers": 28, | |
| "pool": "mean" | |
| }, | |
| "pad_token_id": 151643, | |
| "problem_type": "multi_label_classification", | |
| "rms_norm_eps": 1e-06, | |
| "rope_parameters": { | |
| "rope_theta": 1000000, | |
| "rope_type": "default" | |
| }, | |
| "sliding_window": null, | |
| "tie_word_embeddings": true, | |
| "transformers_version": "5.14.1", | |
| "use_cache": false, | |
| "use_sliding_window": false, | |
| "vocab_size": 151936 | |
| } | |