Image-Text-to-Text
Transformers
TensorBoard
Safetensors
multilingual
internvl_chat
feature-extraction
internvl
custom_code
conversational
Instructions to use OpenGVLab/InternVL-Chat-V1-5 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use OpenGVLab/InternVL-Chat-V1-5 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-5", 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-5", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use OpenGVLab/InternVL-Chat-V1-5 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-5" # 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-5", "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-5
- SGLang
How to use OpenGVLab/InternVL-Chat-V1-5 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-5" \ --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-5", "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-5" \ --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-5", "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-5 with Docker Model Runner:
docker model run hf.co/OpenGVLab/InternVL-Chat-V1-5
Commit History
-
BugFix: AttributeError: 'InternVLChatConfig' object has no attribute 'llm_config'
Verified signatureWhen loading InternVideo2_5_Chat_8B model or InternVL2_5 series models: It raises AttributeError: 'InternVLChatConfig' object has no attribute 'llm_config' Please refer: https://huggingface.co/OpenGVLab/InternVideo2_5_Chat_8B/discussions/14 ### Simple Solution for InternVL Configuration Issue *(Tested with transformers v4.52.4)* #### Required Modifications 1. **Add Initialization** (configuration_internvl_chat.py:49) ```python self.vision_config = InternVisionConfig(**vision_config) self.llm_config = None # Initialize llm_config to prevent AttributeError ``` 2. **Add Null Check** (configuration_internvl_chat.py:85) ```python output['llm_config'] = self.llm_config.to_dict() if self.llm_config is not None else {} ``` #### Root Cause Analysis When executing: ```python model = AutoModel.from_pretrained(model_path, trust_remote_code=True).half().cuda().to(torch.bfloat16) ``` The following occurs: 1. The Hugging Face framework downloads and…0bd2da7
-
Add supports_gradient_checkpointing
Verified signature5fde09e
-
Fix device_map
Verified signaturedc8fc3c
-
Update AWQ models
Verified signaturef6ad5ba -
Update README.md
Verified signature33e2c85 -
Update README.md
Verified signaturef21c31f
-
Update README.md
Verified signature3d6d105
-
Apply Github PR #127 to all HF models
Verified signature954a640 -
Update README.md
Verified signature228b9f8
-
Update README.md
Verified signaturebb03296
-
fix compatibility issue for transformers 4.46+
Verified signaturecc8b439 -
fix compatibility issue for transformers 4.46+
Verified signature078b59a
-
fix compatibility issue for transformers 4.46+
Verified signaturec01313c -
fix compatibility issue for transformers 4.46+
Verified signature3212bee
-
Upload folder using huggingface_hub
Verified signaturec443cca
-
Upload folder using huggingface_hub
Verified signature59ef538 -
Upload folder using huggingface_hub
Verified signaturebb36861 -
Upload folder using huggingface_hub
Verified signature94a7050
-
Upload folder using huggingface_hub
Verified signatured4a4bc3 -
Upload folder using huggingface_hub
Verified signaturedee0c1b -
Upload folder using huggingface_hub
Verified signature73c0b81
-
Upload folder using huggingface_hub
Verified signature9db32d9
-
Upload folder using huggingface_hub
Verified signature31e4bd4
-
Upload folder using huggingface_hub
Verified signature7e21005 -
Upload folder using huggingface_hub
Verified signature93bc3f7
-
Upload folder using huggingface_hub
Verified signatureec2f554
-
Upload folder using huggingface_hub
Verified signatureedfdba5 -
Upload folder using huggingface_hub
Verified signature3e6175d
-
Upload folder using huggingface_hub
Verified signatureef3de63 -
Upload folder using huggingface_hub
Verified signaturec434bf9
-
Upload folder using huggingface_hub
Verified signature2e59614 -
Upload folder using huggingface_hub
Verified signature1166d67 -
Upload folder using huggingface_hub
Verified signaturede43c5d -
Upload folder using huggingface_hub
Verified signatureeca52d9 -
Upload folder using huggingface_hub
Verified signature95a0dbd
-
Upload folder using huggingface_hub
Verified signaturec279137
-
Upload folder using huggingface_hub
Verified signature9a03ae4
-
Upload folder using huggingface_hub
Verified signature847fe01
-
Upload folder using huggingface_hub
Verified signature9cfba21 -
Upload folder using huggingface_hub
Verified signaturede1bc40 -
Upload folder using huggingface_hub
Verified signature51f4dcf -
Fix task name (#23)
Verified signature- Fix task name (214aa584a79f489f6f0310941ca8a5d7f0e9f4dc) Co-authored-by: Merve Noyan <merve@users.noreply.huggingface.co>7ccb35d
-
Update README.md
Verified signature93a63ac
-
Upload folder using huggingface_hub
Verified signature1352871 -
Upload folder using huggingface_hub
Verified signature40b10d5 -
Delete runs
Verified signature1d18a1a -
Upload folder using huggingface_hub
Verified signaturee428d19
-
Update config.json
Verified signaturefdc2259
-
Update modeling_internvl_chat.py
Verified signature6561410
-
Create preprocessor_config.json
Verified signaturee822119