Image-Text-to-Text
Transformers
Safetensors
multilingual
internvl_chat
feature-extraction
internvl
custom_code
conversational
Instructions to use OpenGVLab/InternVL2-26B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use OpenGVLab/InternVL2-26B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="OpenGVLab/InternVL2-26B", 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/InternVL2-26B", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use OpenGVLab/InternVL2-26B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "OpenGVLab/InternVL2-26B" # 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/InternVL2-26B", "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/InternVL2-26B
- SGLang
How to use OpenGVLab/InternVL2-26B 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/InternVL2-26B" \ --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/InternVL2-26B", "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/InternVL2-26B" \ --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/InternVL2-26B", "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/InternVL2-26B with Docker Model Runner:
docker model run hf.co/OpenGVLab/InternVL2-26B
Commit History
-
Add supports_gradient_checkpointing
Verified signature46f3797
-
Fix device_map
Verified signature3248c88
-
Update README.md
Verified signaturee3247d2
-
Update README.md
Verified signaturef31922a
-
Apply Github PR #127 to all HF models
Verified signature1dfb3a1 -
Update README.md
Verified signature1bfc2ba
-
Update README.md
Verified signature102b9d2
-
Delete 20241205_023919
Verified signature03aa097 -
fix compatibility issue for transformers 4.46+
Verified signaturea2b700e
-
fix compatibility issue for transformers 4.46+
Verified signature723ae14 -
fix compatibility issue for transformers 4.46+
Verified signaturef0d4208
-
Upload folder using huggingface_hub
Verified signaturefff422f
-
Upload folder using huggingface_hub
Verified signature696d810 -
Upload folder using huggingface_hub
Verified signature4a03a6f -
Upload folder using huggingface_hub
Verified signatureffe5d3e -
Upload folder using huggingface_hub
Verified signatureebee75c -
Upload folder using huggingface_hub
Verified signature171d19c -
Upload folder using huggingface_hub
Verified signature792f9f7
-
Upload folder using huggingface_hub
Verified signature892107a -
Upload folder using huggingface_hub
Verified signature77238d4 -
Upload folder using huggingface_hub
Verified signaturec4d0d46
-
Delete internvl_v2.zip
Verified signatureb9f3c7e -
Upload folder using huggingface_hub
Verified signature7249645
-
Upload internvl_v2.zip with huggingface_hub
Verified signaturefcbf204
-
Upload folder using huggingface_hub
Verified signaturef8a81c3
-
Upload folder using huggingface_hub
Verified signatureb7d02ef -
Upload folder using huggingface_hub
Verified signature015995d
-
Upload folder using huggingface_hub
Verified signature312d2c0 -
Upload folder using huggingface_hub
Verified signatureffa3516
-
Upload folder using huggingface_hub
Verified signature212a3b9
-
Upload folder using huggingface_hub
Verified signature17a4f19
-
Upload folder using huggingface_hub
Verified signature676fba3 -
Upload folder using huggingface_hub
Verified signature3018e24
-
Upload folder using huggingface_hub
Verified signature7511dda -
Upload folder using huggingface_hub
Verified signatureecf39d3 -
Upload folder using huggingface_hub
Verified signature101362a
-
Upload folder using huggingface_hub
Verified signature7a2e693
-
Upload folder using huggingface_hub
Verified signature62b45e4 -
Upload folder using huggingface_hub
Verified signature7f89441 -
Upload folder using huggingface_hub
Verified signaturec39bf9a -
Upload folder using huggingface_hub
Verified signature5becd13 -
Upload folder using huggingface_hub
Verified signature05d2f27 -
Upload folder using huggingface_hub
Verified signature8376215
-
Upload folder using huggingface_hub
Verified signature81ae45a
-
Upload folder using huggingface_hub
Verified signature7bdd9ff
-
Upload folder using huggingface_hub
Verified signature0424a25 -
Upload folder using huggingface_hub
Verified signature24659dc
-
Upload folder using huggingface_hub
Verified signaturef3e0980 -
Upload folder using huggingface_hub
Verified signatured289811 -
Upload folder using huggingface_hub
Verified signatureabba067