Image-Text-to-Text
Transformers
Safetensors
multilingual
internvl_chat
feature-extraction
internvl
vision
ocr
custom_code
Mixture of Experts
conversational
Instructions to use OpenGVLab/Mono-InternVL-2B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use OpenGVLab/Mono-InternVL-2B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="OpenGVLab/Mono-InternVL-2B", trust_remote_code=True) 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 AutoModel model = AutoModel.from_pretrained("OpenGVLab/Mono-InternVL-2B", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use OpenGVLab/Mono-InternVL-2B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "OpenGVLab/Mono-InternVL-2B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "OpenGVLab/Mono-InternVL-2B", "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/OpenGVLab/Mono-InternVL-2B
- SGLang
How to use OpenGVLab/Mono-InternVL-2B 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 "OpenGVLab/Mono-InternVL-2B" \ --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": "OpenGVLab/Mono-InternVL-2B", "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 "OpenGVLab/Mono-InternVL-2B" \ --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": "OpenGVLab/Mono-InternVL-2B", "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 OpenGVLab/Mono-InternVL-2B with Docker Model Runner:
docker model run hf.co/OpenGVLab/Mono-InternVL-2B
Commit History
-
Fix remaining Transformers v5 crash: guard llm_config and to_dict() for None (follow-up to `e980c02`) (#13)
- Fix remaining Transformers v5 crash: guard llm_config and to_dict() for None (follow-up to `e980c02`) (74146a7858879da8971633b691ead4e203db3a8e) Co-authored-by: Khadija Bayoud <KBayoud@users.noreply.huggingface.co>2520fda -
Fix KeyError in __init__ when vision_config is empty (Transformers v5 compatibility) (#12)
- Fix KeyError in __init__ when vision_config is empty (Transformers v5 compatibility) (e668479718c5b5e27415f2409b8318feb700ed9d) Co-authored-by: Khadija Bayoud <KBayoud@users.noreply.huggingface.co>e980c02
-
Update README.md
Verified signature2fbe186
-
Update README.md
Verified signature1f1c12d
-
Update README.md
Verified signature0d5b434
-
Update README.md
Verified signature6ad7be1
-
Update README.md
Verified signature510ef94
-
Update README.md
Verified signaturea4d0762 -
Update README.md
Verified signaturee4862f8
-
Update README.md
Verified signature1739565
-
Update README.md
Verified signatured6377cc
-
Update README.md
Verified signature88189f6 -
chinese post
Verified signatureeb1d093
-
Update config.json (#7)
Verified signature- Update config.json (d7fffa63887f8477adb4bce38791aa2ee38380ed) Co-authored-by: dou wenhan <douwh@users.noreply.huggingface.co>c5f9f43 -
Update README.md
Verified signaturecd529ff -
Update modeling_internlm2_ve.py (#6)
Verified signature- Update modeling_internlm2_ve.py (40e5dc42cdbd98aafc20738caadd02a89eb63e3e) Co-authored-by: Gen Luo <favor123@users.noreply.huggingface.co>a4c0f7d -
Update README.md
Verified signature82e212b
-
Update README.md
Verified signaturea0ddf17 -
Upload image1.jpg
Verified signaturead75055 -
Upload 18 files (#5)
Verified signature- Upload 18 files (0e37d4eca76d5ba35f7cdc00fa818f627ed47261) Co-authored-by: dou wenhan <douwh@users.noreply.huggingface.co>0e1e0cf -
Update README.md
Verified signature3c63f40 -
Update README.md (#4)
Verified signature- Update README.md (69ecc5d7db9b03013565f1ce11e3c9c95d581545) Co-authored-by: dou wenhan <douwh@users.noreply.huggingface.co>5717ea1 -
Update README.md
Verified signatureb190a1c -
Update README.md
Verified signature63391d9 -
Update README.md (#2)
Verified signature- Update README.md (201161704f6f2a9579e26b0f4948ce9173bf2824) Co-authored-by: Gen Luo <favor123@users.noreply.huggingface.co>a9c20d5 -
Update README.md (#3)
Verified signature- Update README.md (667ef563005e80bc54eec06ad17539e6ab187815) Co-authored-by: Gen Luo <favor123@users.noreply.huggingface.co>462fab0 -
Update README.md (#1)
Verified signature- Update README.md (7b8d7c66db60c1ab6e9dc94b34574f15e0340b16) Co-authored-by: Gen Luo <favor123@users.noreply.huggingface.co>3f83efc
-
Upload 2 files
Verified signature6838961 -
Update README.md
Verified signatured8210be -
initial commit
Verified signature21d482e