Image-Text-to-Text
Transformers
Safetensors
English
qwen3_5
text-generation-inference
JSON
image-classification
content-safety
content-moderation
multimodal
safety-classifier
guardrail
ncii-detection
visual-safety
qwen3.5
multimodal-content-filter
conversational
Instructions to use prithivMLmods/ImageShield-MMCF-0.8B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use prithivMLmods/ImageShield-MMCF-0.8B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="prithivMLmods/ImageShield-MMCF-0.8B") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("prithivMLmods/ImageShield-MMCF-0.8B") model = AutoModelForMultimodalLM.from_pretrained("prithivMLmods/ImageShield-MMCF-0.8B", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use prithivMLmods/ImageShield-MMCF-0.8B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "prithivMLmods/ImageShield-MMCF-0.8B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "prithivMLmods/ImageShield-MMCF-0.8B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/prithivMLmods/ImageShield-MMCF-0.8B
- SGLang
How to use prithivMLmods/ImageShield-MMCF-0.8B with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "prithivMLmods/ImageShield-MMCF-0.8B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "prithivMLmods/ImageShield-MMCF-0.8B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "prithivMLmods/ImageShield-MMCF-0.8B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "prithivMLmods/ImageShield-MMCF-0.8B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use prithivMLmods/ImageShield-MMCF-0.8B with Docker Model Runner:
docker model run hf.co/prithivMLmods/ImageShield-MMCF-0.8B
Update README.md
Browse files
README.md
CHANGED
|
@@ -141,9 +141,6 @@ print(output_text[0])
|
|
| 141 |
|
| 142 |
<div style="background-color: #000000; font-family: 'Courier New', Courier, monospace; color: #FFFFFF; padding: 24px; border-radius: 12px; border: 1px solid #333333; max-width: 800px; margin: 0 auto;">
|
| 143 |
|
| 144 |
-
<!-- Thin Line Bar (Top Separator) -->
|
| 145 |
-
<hr style="border: 0; border-top: 1px solid #333333; margin: 0 0 32px 0;">
|
| 146 |
-
|
| 147 |
<!-- Card 1 -->
|
| 148 |
<div style="margin-bottom: 32px;">
|
| 149 |
<div style="border-radius: 8px; overflow: hidden; margin-bottom: 16px; border: 1px solid #222;">
|
|
@@ -165,7 +162,7 @@ print(output_text[0])
|
|
| 165 |
<!-- Card 2 (NSFW - Blurred) -->
|
| 166 |
<div style="margin-bottom: 32px;">
|
| 167 |
<div style="border-radius: 8px; overflow: hidden; margin-bottom: 16px; border: 1px solid #222; position: relative;">
|
| 168 |
-
<img src="https://cdn-uploads.huggingface.co/production/uploads/65bb837dbfb878f46c77de4c/CjoTJmmvn1HCjtc4ou0cT.png" alt="NSFW Image 2" style="width: 100%; height: auto; display: block; filter: blur(40px) saturate(0.
|
| 169 |
</div>
|
| 170 |
<pre style="background-color: #0a0a0a; padding: 16px; border-radius: 8px; border: 1px solid #222; color: #e0e0e0; font-size: 13px; line-height: 1.6; white-space: pre-wrap; word-wrap: break-word; margin: 0;">
|
| 171 |
{
|
|
|
|
| 141 |
|
| 142 |
<div style="background-color: #000000; font-family: 'Courier New', Courier, monospace; color: #FFFFFF; padding: 24px; border-radius: 12px; border: 1px solid #333333; max-width: 800px; margin: 0 auto;">
|
| 143 |
|
|
|
|
|
|
|
|
|
|
| 144 |
<!-- Card 1 -->
|
| 145 |
<div style="margin-bottom: 32px;">
|
| 146 |
<div style="border-radius: 8px; overflow: hidden; margin-bottom: 16px; border: 1px solid #222;">
|
|
|
|
| 162 |
<!-- Card 2 (NSFW - Blurred) -->
|
| 163 |
<div style="margin-bottom: 32px;">
|
| 164 |
<div style="border-radius: 8px; overflow: hidden; margin-bottom: 16px; border: 1px solid #222; position: relative;">
|
| 165 |
+
<img src="https://cdn-uploads.huggingface.co/production/uploads/65bb837dbfb878f46c77de4c/CjoTJmmvn1HCjtc4ou0cT.png" alt="NSFW Image 2" style="width: 100%; height: auto; display: block; filter: blur(40px) saturate(0.8) brightness(0.9); transform: scale(1.1);">
|
| 166 |
</div>
|
| 167 |
<pre style="background-color: #0a0a0a; padding: 16px; border-radius: 8px; border: 1px solid #222; color: #e0e0e0; font-size: 13px; line-height: 1.6; white-space: pre-wrap; word-wrap: break-word; margin: 0;">
|
| 168 |
{
|