Image-Text-to-Text
Transformers
TensorBoard
Safetensors
multilingual
internvl_chat
feature-extraction
internvl
custom_code
conversational
Instructions to use OpenGVLab/InternVL-Chat-V1-2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use OpenGVLab/InternVL-Chat-V1-2 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", 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", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use OpenGVLab/InternVL-Chat-V1-2 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" # 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", "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
- SGLang
How to use OpenGVLab/InternVL-Chat-V1-2 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" \ --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", "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" \ --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", "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 with Docker Model Runner:
docker model run hf.co/OpenGVLab/InternVL-Chat-V1-2
Commit History
-
Add supports_gradient_checkpointing
Verified signature60f4206
-
Fix device_map
Verified signatureb4d9a57
-
Update README.md
Verified signaturede73580
-
Update README.md
Verified signatureab7f34b
-
Apply Github PR #127 to all HF models
Verified signature6db35de -
Update README.md
Verified signatured8ae000
-
Update README.md
Verified signature06a956a
-
Upload folder using huggingface_hub
Verified signature09e1621 -
Upload folder using huggingface_hub
Verified signature483236b -
Upload folder using huggingface_hub
Verified signaturef797792
-
Upload folder using huggingface_hub
Verified signatureca1856d
-
Upload folder using huggingface_hub
Verified signature594f7d1 -
Upload folder using huggingface_hub
Verified signature9a60327 -
Upload folder using huggingface_hub
Verified signaturece69c4e
-
Upload folder using huggingface_hub
Verified signature6f26090 -
Upload folder using huggingface_hub
Verified signature966cdab
-
Upload folder using huggingface_hub
Verified signature5202785
-
Upload folder using huggingface_hub
Verified signature9283f81
-
Upload folder using huggingface_hub
Verified signature043b98d -
Upload folder using huggingface_hub
Verified signature091bb50
-
Upload folder using huggingface_hub
Verified signaturef12cf18 -
Upload folder using huggingface_hub
Verified signature2bf07d3
-
Upload folder using huggingface_hub
Verified signature86fa89e -
Update README.md
Verified signature932b6de -
Update README.md
Verified signature450aed5
-
Update README.md
Verified signature8314959 -
Update README.md
Verified signature33f58e3 -
Update README.md
Verified signature5b53772
-
Delete trainer_state.json
Verified signature3d1eb08 -
Delete train_results.json
Verified signature7c3e90f
-
Update README.md
Verified signature655f38e
-
Update README.md
Verified signature57e108a
-
Update README.md
Verified signature717d6d8
-
Update README.md
Verified signature1989374 -
Update README.md
Verified signaturec3fc69d -
Update README.md
Verified signatureece5278 -
Update README.md
Verified signature27004c6 -
Update README.md
Verified signature62d21d2
-
Update modeling_internvl_chat.py
Verified signature4635e95
-
Update README.md
Verified signature8ac6dc0 -
Upload folder using huggingface_hub
Verified signaturea4beb5a -
Upload folder using huggingface_hub
Verified signatured1dc194 -
Update README.md
Verified signature88c4cde -
Update README.md
Verified signature4fc560d
-
Update README.md
Verified signature5e3932e
-
Update conversation.py
Verified signature20cb595
-
Update README.md
Verified signatureb6b0045 -
Update README.md
Verified signatureacbf352 -
Upload folder using huggingface_hub
Verified signature170bf72 -
Upload folder using huggingface_hub
Verified signatureacf2cf6