Image-Text-to-Text
Transformers
TensorBoard
Safetensors
multilingual
internvl_chat
feature-extraction
internvl
custom_code
conversational
Instructions to use OpenGVLab/InternVL2_5-78B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use OpenGVLab/InternVL2_5-78B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="OpenGVLab/InternVL2_5-78B", 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)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("OpenGVLab/InternVL2_5-78B", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use OpenGVLab/InternVL2_5-78B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "OpenGVLab/InternVL2_5-78B" # 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_5-78B", "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_5-78B
- SGLang
How to use OpenGVLab/InternVL2_5-78B 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_5-78B" \ --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_5-78B", "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_5-78B" \ --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_5-78B", "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_5-78B with Docker Model Runner:
docker model run hf.co/OpenGVLab/InternVL2_5-78B
Fix device_map
Browse files- .gitattributes +1 -0
- README.md +3 -0
- examples/image2.jpg +0 -0
.gitattributes
CHANGED
|
@@ -34,3 +34,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
examples/red-panda.mp4 filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
examples/red-panda.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
examples/image2.jpg filter=lfs diff=lfs merge=lfs -text
|
README.md
CHANGED
|
@@ -13,6 +13,8 @@ language:
|
|
| 13 |
tags:
|
| 14 |
- internvl
|
| 15 |
- custom_code
|
|
|
|
|
|
|
| 16 |
---
|
| 17 |
|
| 18 |
# InternVL2_5-78B
|
|
@@ -365,6 +367,7 @@ def split_model(model_name):
|
|
| 365 |
device_map['language_model.model.embed_tokens'] = 0
|
| 366 |
device_map['language_model.output'] = 0
|
| 367 |
device_map['language_model.model.norm'] = 0
|
|
|
|
| 368 |
device_map['language_model.lm_head'] = 0
|
| 369 |
device_map[f'language_model.model.layers.{num_layers - 1}'] = 0
|
| 370 |
|
|
|
|
| 13 |
tags:
|
| 14 |
- internvl
|
| 15 |
- custom_code
|
| 16 |
+
datasets:
|
| 17 |
+
- HuggingFaceFV/finevideo
|
| 18 |
---
|
| 19 |
|
| 20 |
# InternVL2_5-78B
|
|
|
|
| 367 |
device_map['language_model.model.embed_tokens'] = 0
|
| 368 |
device_map['language_model.output'] = 0
|
| 369 |
device_map['language_model.model.norm'] = 0
|
| 370 |
+
device_map['language_model.model.rotary_emb'] = 0
|
| 371 |
device_map['language_model.lm_head'] = 0
|
| 372 |
device_map[f'language_model.model.layers.{num_layers - 1}'] = 0
|
| 373 |
|
examples/image2.jpg
CHANGED
|
|
Git LFS Details
|