Image-Text-to-Text
Transformers
Safetensors
English
mllama
text-generation-inference
unsloth
conversational
Instructions to use NYUAD-ComNets/Llama3.2_MultiModal_Memes_Hate_Detector with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use NYUAD-ComNets/Llama3.2_MultiModal_Memes_Hate_Detector with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="NYUAD-ComNets/Llama3.2_MultiModal_Memes_Hate_Detector") 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)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("NYUAD-ComNets/Llama3.2_MultiModal_Memes_Hate_Detector") model = AutoModelForMultimodalLM.from_pretrained("NYUAD-ComNets/Llama3.2_MultiModal_Memes_Hate_Detector", 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=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use NYUAD-ComNets/Llama3.2_MultiModal_Memes_Hate_Detector with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "NYUAD-ComNets/Llama3.2_MultiModal_Memes_Hate_Detector" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "NYUAD-ComNets/Llama3.2_MultiModal_Memes_Hate_Detector", "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/NYUAD-ComNets/Llama3.2_MultiModal_Memes_Hate_Detector
- SGLang
How to use NYUAD-ComNets/Llama3.2_MultiModal_Memes_Hate_Detector 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 "NYUAD-ComNets/Llama3.2_MultiModal_Memes_Hate_Detector" \ --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": "NYUAD-ComNets/Llama3.2_MultiModal_Memes_Hate_Detector", "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 "NYUAD-ComNets/Llama3.2_MultiModal_Memes_Hate_Detector" \ --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": "NYUAD-ComNets/Llama3.2_MultiModal_Memes_Hate_Detector", "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" } } ] } ] }' - Unsloth Desktop
- Docker Model Runner
How to use NYUAD-ComNets/Llama3.2_MultiModal_Memes_Hate_Detector with Docker Model Runner:
docker model run hf.co/NYUAD-ComNets/Llama3.2_MultiModal_Memes_Hate_Detector
Update README.md
Browse files
README.md
CHANGED
|
@@ -12,12 +12,6 @@ language:
|
|
| 12 |
|
| 13 |
# Llama3.2 based Hate Detection in Arabic MultiModal Memes
|
| 14 |
|
| 15 |
-
- **Developed by:** NYUAD-ComNets
|
| 16 |
-
- **License:** apache-2.0
|
| 17 |
-
- **Finetuned from model :** unsloth/llama-3.2-11b-vision-instruct-unsloth-bnb-4bit
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
The rise of social media and online communication platforms has led to the spread of Arabic memes as a key form of digital expression.
|
| 22 |
While these contents can be humorous and informative, they are also increasingly being used to spread offensive language and hate speech.
|
| 23 |
Consequently, there is a growing demand for precise analysis of content in Arabic meme.
|
|
@@ -25,7 +19,8 @@ Consequently, there is a growing demand for precise analysis of content in Arabi
|
|
| 25 |
This work used Llama 3.2 with its vision capability to effectively identify hate content within Arabic memes.
|
| 26 |
The evaluation is conducted using a dataset of Arabic memes proposed in the ArabicNLP MAHED 2025 challenge.
|
| 27 |
The results underscore the capacity of Llama 3.2-11B fine-tuned with Arabic memes, to deliver the superior performance.
|
| 28 |
-
|
|
|
|
| 29 |
|
| 30 |
The proposed solutions offer a more nuanced understanding of memes for accurate and efficient Arabic content moderation systems.
|
| 31 |
|
|
|
|
| 12 |
|
| 13 |
# Llama3.2 based Hate Detection in Arabic MultiModal Memes
|
| 14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
The rise of social media and online communication platforms has led to the spread of Arabic memes as a key form of digital expression.
|
| 16 |
While these contents can be humorous and informative, they are also increasingly being used to spread offensive language and hate speech.
|
| 17 |
Consequently, there is a growing demand for precise analysis of content in Arabic meme.
|
|
|
|
| 19 |
This work used Llama 3.2 with its vision capability to effectively identify hate content within Arabic memes.
|
| 20 |
The evaluation is conducted using a dataset of Arabic memes proposed in the ArabicNLP MAHED 2025 challenge.
|
| 21 |
The results underscore the capacity of Llama 3.2-11B fine-tuned with Arabic memes, to deliver the superior performance.
|
| 22 |
+
|
| 23 |
+
They achieve accuracy of 80.3% and macro F1 score of 73.3%.
|
| 24 |
|
| 25 |
The proposed solutions offer a more nuanced understanding of memes for accurate and efficient Arabic content moderation systems.
|
| 26 |
|