Image-Text-to-Text
Transformers
Safetensors
multilingual
internvl_chat
feature-extraction
internvl
custom_code
conversational
Instructions to use OpenGVLab/InternVL2-Llama3-76B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use OpenGVLab/InternVL2-Llama3-76B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="OpenGVLab/InternVL2-Llama3-76B", 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-Llama3-76B", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use OpenGVLab/InternVL2-Llama3-76B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "OpenGVLab/InternVL2-Llama3-76B" # 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-Llama3-76B", "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-Llama3-76B
- SGLang
How to use OpenGVLab/InternVL2-Llama3-76B 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-Llama3-76B" \ --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-Llama3-76B", "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-Llama3-76B" \ --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-Llama3-76B", "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-Llama3-76B with Docker Model Runner:
docker model run hf.co/OpenGVLab/InternVL2-Llama3-76B
Commit History
18 days ago
-
Add image_token_id to config.json
Verified signatureAdds `image_token_id` to `config.json`, set to the id of `<IMG_CONTEXT>` in this repo's tokenizer (128258). With it, this checkpoint loads into the native `InternVLForConditionalGeneration` in transformers without `trust_remote_code` (huggingface/transformers#47047), which reads the image token id from the config. The remote code is unaffected: `InternVLChatConfig` keeps unknown keys as attributes, and `InternVLChatModel` still reads the id from the tokenizer.09b72e5
-
Add supports_gradient_checkpointing
Verified signature9d9aa88
-
Fix device_map
Verified signature2801a1a
-
Update README.md
Verified signature02e7994
-
Update README.md
Verified signatureb40558d
-
Apply Github PR #127 to all HF models
Verified signature859659b -
Update README.md
Verified signatured044c87
-
Update README.md
Verified signature963014e
-
fix compatibility issue for transformers 4.46+
Verified signature83e64d2
-
fix compatibility issue for transformers 4.46+
Verified signature1da41a7 -
fix compatibility issue for transformers 4.46+
Verified signature9030eca
-
Upload folder using huggingface_hub
Verified signature10a6bf4
-
Upload folder using huggingface_hub
Verified signaturee05e822 -
Upload folder using huggingface_hub
Verified signature64d1142 -
Upload folder using huggingface_hub
Verified signature5dd7763 -
Upload folder using huggingface_hub
Verified signaturee2aff1c
-
Upload folder using huggingface_hub
Verified signature17563fb -
Upload folder using huggingface_hub
Verified signature61795f0 -
Upload folder using huggingface_hub
Verified signaturee1f89bc
-
Upload folder using huggingface_hub
Verified signaturecf79149
-
Upload folder using huggingface_hub
Verified signaturec9517cc
-
Upload folder using huggingface_hub
Verified signatured170517 -
Upload folder using huggingface_hub
Verified signatureb47d2e8 -
Upload folder using huggingface_hub
Verified signature9de62f3
-
Upload folder using huggingface_hub
Verified signaturef422190 -
Upload folder using huggingface_hub
Verified signature3dae19b
-
Upload folder using huggingface_hub
Verified signature159f0ea
-
Upload folder using huggingface_hub
Verified signaturebb8f5c2
-
Upload folder using huggingface_hub
Verified signature125f7ce -
Upload folder using huggingface_hub
Verified signaturef3f4ec0
-
Update README.md
Verified signature8e7cb30
-
Upload folder using huggingface_hub
Verified signaturec35c17f -
Upload folder using huggingface_hub
Verified signaturee6434df -
Upload folder using huggingface_hub
Verified signature12d403f -
Upload folder using huggingface_hub
Verified signature6ce5764
-
Upload folder using huggingface_hub
Verified signatured067cc5 -
Upload folder using huggingface_hub
Verified signaturec85e698
-
Upload folder using huggingface_hub
Verified signatured640123 -
Upload folder using huggingface_hub
Verified signaturee779c52 -
Upload folder using huggingface_hub
Verified signaturea8040d2 -
Upload folder using huggingface_hub
Verified signature86be9d8 -
Upload folder using huggingface_hub
Verified signature42f9ca4 -
Upload folder using huggingface_hub
Verified signature7e98f54
-
Upload folder using huggingface_hub
Verified signaturec0189e3 -
Upload folder using huggingface_hub
Verified signatureb6807cb -
initial commit
Verified signature6727280