Image-Text-to-Text
Transformers
Safetensors
English
multimodal
hateful-speech-detection
conversational
Instructions to use Jingbiao/Qwen2-VL-7B-Harm-C-LMM-RGCL with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Jingbiao/Qwen2-VL-7B-Harm-C-LMM-RGCL with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Jingbiao/Qwen2-VL-7B-Harm-C-LMM-RGCL") 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 AutoModel model = AutoModel.from_pretrained("Jingbiao/Qwen2-VL-7B-Harm-C-LMM-RGCL", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Jingbiao/Qwen2-VL-7B-Harm-C-LMM-RGCL with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Jingbiao/Qwen2-VL-7B-Harm-C-LMM-RGCL" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Jingbiao/Qwen2-VL-7B-Harm-C-LMM-RGCL", "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/Jingbiao/Qwen2-VL-7B-Harm-C-LMM-RGCL
- SGLang
How to use Jingbiao/Qwen2-VL-7B-Harm-C-LMM-RGCL 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 "Jingbiao/Qwen2-VL-7B-Harm-C-LMM-RGCL" \ --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": "Jingbiao/Qwen2-VL-7B-Harm-C-LMM-RGCL", "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 "Jingbiao/Qwen2-VL-7B-Harm-C-LMM-RGCL" \ --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": "Jingbiao/Qwen2-VL-7B-Harm-C-LMM-RGCL", "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 Jingbiao/Qwen2-VL-7B-Harm-C-LMM-RGCL with Docker Model Runner:
docker model run hf.co/Jingbiao/Qwen2-VL-7B-Harm-C-LMM-RGCL
Improve model card: add pipeline_tag, library_name, license, and paper details
#1
by nielsr HF Staff - opened
This PR significantly improves the model card for the model presented in Robust Adaptation of Large Multimodal Models for Retrieval Augmented Hateful Meme Detection.
Key changes include:
- Updated
library_nametotransformers: This ensures the "How to use" widget properly displays atransformerscode snippet, as the model is compatible withtransformersfor loading and inference of its PEFT adapters. - Added
pipeline_tag: image-text-to-text: This makes the model discoverable under the appropriate task category on the Hugging Face Hub, reflecting its multimodal input and text output capabilities. - Added
license: cc-by-4.0: Provides clear licensing information. - Added
language: enand relevanttags: Enhances model discoverability. - Populated model card content: The model card now includes the paper title, Hugging Face paper link, the abstract as a detailed model description, and filled-out sections for model details, uses, biases, training, and evaluation, providing comprehensive information about the model.
- Added BibTeX citations: The provided BibTeX entries for the associated papers are now correctly placed in the "Citation" section.
Please review and merge this PR if everything looks good.
Jingbiao changed pull request status to merged