Image-Text-to-Text
Transformers
TensorBoard
Safetensors
multilingual
internvl_chat
feature-extraction
internvl
custom_code
conversational
Instructions to use OpenGVLab/InternVL-Chat-V1-2-Plus with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use OpenGVLab/InternVL-Chat-V1-2-Plus with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="OpenGVLab/InternVL-Chat-V1-2-Plus", 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/InternVL-Chat-V1-2-Plus", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use OpenGVLab/InternVL-Chat-V1-2-Plus with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "OpenGVLab/InternVL-Chat-V1-2-Plus" # 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/InternVL-Chat-V1-2-Plus", "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/InternVL-Chat-V1-2-Plus
- SGLang
How to use OpenGVLab/InternVL-Chat-V1-2-Plus 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/InternVL-Chat-V1-2-Plus" \ --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/InternVL-Chat-V1-2-Plus", "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/InternVL-Chat-V1-2-Plus" \ --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/InternVL-Chat-V1-2-Plus", "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/InternVL-Chat-V1-2-Plus with Docker Model Runner:
docker model run hf.co/OpenGVLab/InternVL-Chat-V1-2-Plus
Commit History
-
Add supports_gradient_checkpointing
Verified signature71bf9db
-
Fix device_map
Verified signature6171c13
-
Update README.md
Verified signature87afe12
-
Update README.md
Verified signaturea950658
-
Apply Github PR #127 to all HF models
Verified signaturefb24b40 -
Update README.md
Verified signature3a7b533
-
Update README.md
Verified signatureb7dff48
-
Upload folder using huggingface_hub
Verified signature523db58 -
Upload folder using huggingface_hub
Verified signature92a1793 -
Upload folder using huggingface_hub
Verified signature21bb657
-
Upload folder using huggingface_hub
Verified signaturec391cab
-
Upload folder using huggingface_hub
Verified signatureacc9f3d -
Upload folder using huggingface_hub
Verified signature3ecd833 -
Upload folder using huggingface_hub
Verified signatured348ad6
-
Upload folder using huggingface_hub
Verified signaturef19aeab -
Upload folder using huggingface_hub
Verified signature2e21796
-
Upload folder using huggingface_hub
Verified signature1dd2047
-
Upload folder using huggingface_hub
Verified signaturef3485d6
-
Upload folder using huggingface_hub
Verified signature3f3b4b8 -
Upload folder using huggingface_hub
Verified signature31f011d
-
Upload folder using huggingface_hub
Verified signature1173f4b -
Upload folder using huggingface_hub
Verified signaturec0fcaaf -
Delete runs/Feb18_14-05-57_SH-IDC1-10-140-37-8/index.html
Verified signaturecec44a5 -
Delete runs/Feb18_13-14-12_SH-IDC1-10-140-37-8/index.html
Verified signature2f5368f -
Delete runs/index.html
Verified signaturefc7a5aa -
Delete trainer_state.json
Verified signaturea7048ac
-
Upload folder using huggingface_hub
Verified signature6d27cbe -
Update README.md
Verified signature21cbe95 -
Update README.md
Verified signature5268958
-
Update README.md
Verified signaturebbccbf7 -
Update README.md
Verified signature1129ac8
-
Update README.md
Verified signature2217075
-
Update README.md
Verified signature0593a76
-
Update README.md
Verified signature973b6d6
-
Update README.md
Verified signatureb83ee00 -
Update README.md
Verified signaturede2e232
-
Update modeling_internvl_chat.py
Verified signature15083a1
-
Update README.md
Verified signature170f44e -
Upload folder using huggingface_hub
Verified signature3b63e0f -
Update README.md
Verified signaturec5f6e4f
-
Update README.md
Verified signature385bcee
-
Upload preprocessor_config.json (#1)
Verified signature- Upload preprocessor_config.json (d668de508f8f2f3342079ccd6a9283bd53118cd4) Co-authored-by: George <nemonameless@users.noreply.huggingface.co>21d6ce2
-
Update conversation.py
Verified signature811ad48
-
Update README.md
Verified signature3d4f094 -
Update README.md
Verified signature2aae8fa -
Upload folder using huggingface_hub
Verified signature5ccea55 -
Update README.md
Verified signature85f05e5 -
Update README.md
Verified signature511aa96 -
Update README.md
Verified signature0c73ddc -
Update README.md
Verified signatureaa21a1f