File size: 3,486 Bytes
b0d2ed9
 
 
 
af76660
b0d2ed9
 
 
 
af76660
b0d2ed9
 
 
af76660
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b0d2ed9
af76660
 
 
b0d2ed9
af76660
 
 
 
 
 
 
 
 
 
 
b0d2ed9
 
 
 
 
 
af76660
b0d2ed9
 
 
 
af76660
b0d2ed9
 
 
af76660
b0d2ed9
af76660
b0d2ed9
af76660
 
 
 
 
b0d2ed9
 
af76660
 
 
 
 
b0d2ed9
 
 
 
 
af76660
 
 
 
 
 
 
b0d2ed9
af76660
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b0d2ed9
af76660
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
---
license: apache-2.0
language:
- en
- zh
tags:
- safety
- moderation
- multimodal
- omniguard
pipeline_tag: text-generation
---

# OmniGuard: Unified Omni-Modal Guardrails with Deliberate Reasoning

OmniGuard is a multimodal safety evaluation model designed to assess content safety across text, images, audio, and video. Built on the Qwen2.5-Omni architecture, it provides structured safety reasoning and policy enforcement.

## Model Information

- **Model Name**: OmniGuard-3B
- **Base Model**: Qwen2.5-Omni-3B
- **Model Type**: Multimodal Safety Moderation
- **Supported Languages**: English, Chinese
- **Supported Modalities**: Text, Image, Audio, Video
- **License**: Apache-2.0

## Model Variants

We provide two model sizes:

- **[OmniGuard-3B](https://huggingface.co/anonymousICML/OmniGuard-3B)** - 3B parameters for high-accuracy safety evaluation
- **[OmniGuard-3B](https://huggingface.co/anonymousICML/OmniGuard-7B)** - 7B parameters for resource-constrained environments

## Features

- **Omni-Modal Safety Assessment**: Evaluate safety across text, images, audio, and video inputs
- **Structured Reasoning**: Provides deliberate, structured safety analysis beyond binary classification


## Installation

### Quick Setup

```bash
# Install core dependencies
pip install torch transformers accelerate

# Install Qwen2.5-Omni support
pip uninstall transformers -y
pip install git+https://github.com/huggingface/transformers@v4.51.3-Qwen2.5-Omni-preview

```

### Requirements

- Python 3.8+
- PyTorch 2.0+
- CUDA-compatible GPU (recommended)
- 8GB+ GPU memory for 3B model
- Flash Attention 2 (optional, for better performance)

## Usage



```python
from transformers import AutoModelForCausalLM, AutoTokenizer

model_name = "anonymousICML/OmniGuard-3B"
model = AutoModelForCausalLM.from_pretrained(
    model_name,
    torch_dtype="auto",
    device_map="auto",
    attn_implementation="flash_attention_2"  # Recommended
)
tokenizer = AutoTokenizer.from_pretrained(model_name)

# Text-only safety evaluation
messages = [
    {"role": "user", "content": "Please analyze the safety of this content: [Your content here]"}
]
text = tokenizer.apply_chat_template(
    messages, 
    tokenize=False, 
    add_generation_prompt=True
)
inputs = tokenizer([text], return_tensors="pt").to(model.device)

outputs = model.generate(
    **inputs, 
    max_new_tokens=512, 
    do_sample=False
)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(response)
```


## Ethical Considerations

- This model is designed for safety evaluation and content moderation
- Should be used as part of a comprehensive safety strategy
- May reflect biases present in training data
- Continuous monitoring and updates recommended for production use
- Users are responsible for compliance with applicable laws and regulations

## License

This model is released under the Apache-2.0 license.

## Acknowledgments

- Built on [Qwen2.5-Omni](https://github.com/QwenLM/Qwen2.5-Omni) by Alibaba Cloud
- Uses [LLaMA Guard 3](https://ai.meta.com/research/publications/llama-guard-llm-based-input-output-safeguard-for-human-ai-conversations/) safety framework
- Trained on diverse multimodal safety datasets

## Support

For issues, questions, or contributions:
- Repository: https://github.com/anonymous-2654a/icml-2026-sub
- HuggingFace: https://huggingface.co/anonymousICML

---

**Note**: This is an anonymous submission for ICML 2026. Full details will be released upon acceptance.