Image-Text-to-Text
Transformers
PyTorch
multilingual
internvl_chat
feature-extraction
internvl
custom_code
conversational
Instructions to use OpenGVLab/InternVL2-26B-AWQ with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use OpenGVLab/InternVL2-26B-AWQ with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="OpenGVLab/InternVL2-26B-AWQ", 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-AWQ", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use OpenGVLab/InternVL2-26B-AWQ with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "OpenGVLab/InternVL2-26B-AWQ" # 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-AWQ", "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-AWQ
- SGLang
How to use OpenGVLab/InternVL2-26B-AWQ 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-AWQ" \ --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-AWQ", "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-AWQ" \ --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-AWQ", "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-AWQ with Docker Model Runner:
docker model run hf.co/OpenGVLab/InternVL2-26B-AWQ
Commit History
-
Add supports_gradient_checkpointing
Verified signaturebc0b62b
-
Update README.md
Verified signature22e80ce
-
Update README.md
Verified signature3e72b50
-
Apply Github PR #127 to all HF models
Verified signature67fc787 -
Update README.md
Verified signature377149e
-
Update README.md
Verified signature35dc06f
-
fix compatibility issue for transformers 4.46+
Verified signaturebce6bcb
-
fix compatibility issue for transformers 4.46+
Verified signature86a7fe9 -
fix compatibility issue for transformers 4.46+
Verified signature14d7ed8
-
Upload folder using huggingface_hub
Verified signature2f2d799
-
Upload folder using huggingface_hub
Verified signature6043f46 -
Upload folder using huggingface_hub
Verified signature9419c8b -
Upload folder using huggingface_hub
Verified signature68e3206
-
Upload folder using huggingface_hub
Verified signature3337977 -
Upload folder using huggingface_hub
Verified signaturec92dfd9
-
Upload folder using huggingface_hub
Verified signature469e001
-
Upload folder using huggingface_hub
Verified signaturee29cd5c
-
Upload folder using huggingface_hub
Verified signature7c8f2e6 -
Upload folder using huggingface_hub
Verified signature4d9a64e
-
Update README.md
Verified signature0c1e8f7 -
Upload folder using huggingface_hub
Verified signatureaf5fe51 -
initial commit
Verified signature001c397