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
Commit History
-
Update README.md
Verified signature19736a9
-
Update README.md
Verified signature798d1aa -
Update README.md
Verified signaturec99b934 -
Update README.md
Verified signatureeb777e4
-
Update README.md
Verified signature4884097 -
Update README.md
Verified signature1d2811e -
Update README.md
Verified signaturee41450b -
Update README.md
Verified signature0ffdf9b -
Update README.md
Verified signatureaa04b21 -
Update README.md
Verified signatureb00a702 -
Update README.md
Verified signaturea77a055 -
Update README.md
Verified signaturead3a2e8 -
Update README.md
Verified signature60b7f58 -
Update README.md
Verified signature2843a50 -
Update README.md
Verified signature2e4fe12
-
Update README.md
Verified signature3db455d -
Update README.md
Verified signature5a2ffb6 -
Update README.md
Verified signature97cf8ca -
Update README.md
Verified signature83f11e1 -
Update README.md
Verified signature7199ae6 -
Update README.md
Verified signatureeea982c -
Update README.md
Verified signaturebe4ba9c -
Update README.md
Verified signature5f4fc3b -
Update README.md
Verified signature1dbc326
-
Update README.md
Verified signature4d3a8b2
-
(Trained with Unsloth)
Verified signatureee01a34 -
(Trained with Unsloth)
Verified signaturec9b3a71 -
(Trained with Unsloth)
Verified signature158a1f6 -
(Trained with Unsloth)
Verified signature41b0d54 -
(Trained with Unsloth)
Verified signatured3e340a -
(Trained with Unsloth)
Verified signature67ed435 -
(Trained with Unsloth)
Verified signatureef2cb52 -
(Trained with Unsloth)
Verified signaturedfc7bcc -
(Trained with Unsloth)
Verified signature1e73f37 -
(Trained with Unsloth)
Verified signaturee559adb -
(Trained with Unsloth)
Verified signature0b04351 -
(Trained with Unsloth)
Verified signature3aaace8 -
Unsloth Model Card
Verified signature0d2210c -
initial commit
Verified signature517fa03