Image-Text-to-Text
Transformers
Safetensors
multilingual
internvl_chat
feature-extraction
internvl
custom_code
conversational
Eval Results
Run this model with HF Jobs
Run OpenGVLab/InternVL3-8B on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/OpenGVLab/InternVL3-8B. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/OpenGVLab/InternVL3-8B on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/OpenGVLab/InternVL3-8B. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/OpenGVLab/InternVL3-8B. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use OpenGVLab/InternVL3-8B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use OpenGVLab/InternVL3-8B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="OpenGVLab/InternVL3-8B", 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/InternVL3-8B", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use OpenGVLab/InternVL3-8B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "OpenGVLab/InternVL3-8B" # 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/InternVL3-8B", "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/InternVL3-8B
- SGLang
How to use OpenGVLab/InternVL3-8B 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/InternVL3-8B" \ --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/InternVL3-8B", "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/InternVL3-8B" \ --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/InternVL3-8B", "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/InternVL3-8B with Docker Model Runner:
docker model run hf.co/OpenGVLab/InternVL3-8B
Upload README.md with huggingface_hub
Browse files517 unmodified lines5185195205215225235245255265275285295 unmodified lines53553653753853954054154254354454554611 unmodified lines5585595605615625635645655665675689 unmodified lines5785795805815825835845855865875888 unmodified lines597598599600601602603517 unmodified lines#### A 'Hello, world' Example```pythonfrom lmdeploy import pipeline, TurbomindEngineConfigfrom lmdeploy.vl import load_imagemodel = 'OpenGVLab/InternVL3-8B'image = load_image('https://raw.githubusercontent.com/open-mmlab/mmdeploy/main/tests/data/tiger.jpeg')pipe = pipeline(model, backend_config=TurbomindEngineConfig(session_len=16384, tp=1))response = pipe(('describe this image', image))print(response.text)```5 unmodified linesWhen dealing with multiple images, you can put them all in one list. Keep in mind that multiple images will lead to a higher number of input tokens, and as a result, the size of the context window typically needs to be increased.```pythonfrom lmdeploy import pipeline, TurbomindEngineConfigfrom lmdeploy.vl import load_imagefrom lmdeploy.vl.constants import IMAGE_TOKENmodel = 'OpenGVLab/InternVL3-8B'pipe = pipeline(model, backend_config=TurbomindEngineConfig(session_len=16384, tp=1))image_urls=['https://raw.githubusercontent.com/open-mmlab/mmdeploy/main/demo/resources/human-pose.jpg',11 unmodified linesConducting inference with batch prompts is quite straightforward; just place them within a list structure:```pythonfrom lmdeploy import pipeline, TurbomindEngineConfigfrom lmdeploy.vl import load_imagemodel = 'OpenGVLab/InternVL3-8B'pipe = pipeline(model, backend_config=TurbomindEngineConfig(session_len=16384, tp=1))image_urls=["https://raw.githubusercontent.com/open-mmlab/mmdeploy/main/demo/resources/human-pose.jpg",9 unmodified linesThere are two ways to do the multi-turn conversations with the pipeline. One is to construct messages according to the format of OpenAI and use above introduced method, the other is to use the `pipeline.chat` interface.```pythonfrom lmdeploy import pipeline, TurbomindEngineConfig, GenerationConfigfrom lmdeploy.vl import load_imagemodel = 'OpenGVLab/InternVL3-8B'pipe = pipeline(model, backend_config=TurbomindEngineConfig(session_len=16384, tp=1))image = load_image('https://raw.githubusercontent.com/open-mmlab/mmdeploy/main/demo/resources/human-pose.jpg')gen_config = GenerationConfig(top_k=40, top_p=0.8, temperature=0.8)8 unmodified linesLMDeploy's `api_server` enables models to be easily packed into services with a single command. The provided RESTful APIs are compatible with OpenAI's interfaces. Below are an example of service startup:```shelllmdeploy serve api_server OpenGVLab/InternVL3-8B --server-port 23333 --tp 1```To use the OpenAI-style interface, you need to install OpenAI:517 unmodified lines5185195205215225235245255265275285295 unmodified lines53553653753853954054154254354454554611 unmodified lines5585595605615625635645655665675689 unmodified lines5785795805815825835845855865875888 unmodified lines597598599600601602603517 unmodified lines#### A 'Hello, world' Example```pythonfrom lmdeploy import pipeline, TurbomindEngineConfig, ChatTemplateConfigfrom lmdeploy.vl import load_imagemodel = 'OpenGVLab/InternVL3-8B'image = load_image('https://raw.githubusercontent.com/open-mmlab/mmdeploy/main/tests/data/tiger.jpeg')pipe = pipeline(model, backend_config=TurbomindEngineConfig(session_len=16384, tp=1), chat_template_config=ChatTemplateConfig(model_name='internvl2_5'))response = pipe(('describe this image', image))print(response.text)```5 unmodified linesWhen dealing with multiple images, you can put them all in one list. Keep in mind that multiple images will lead to a higher number of input tokens, and as a result, the size of the context window typically needs to be increased.```pythonfrom lmdeploy import pipeline, TurbomindEngineConfig, ChatTemplateConfigfrom lmdeploy.vl import load_imagefrom lmdeploy.vl.constants import IMAGE_TOKENmodel = 'OpenGVLab/InternVL3-8B'pipe = pipeline(model, backend_config=TurbomindEngineConfig(session_len=16384, tp=1), chat_template_config=ChatTemplateConfig(model_name='internvl2_5'))image_urls=['https://raw.githubusercontent.com/open-mmlab/mmdeploy/main/demo/resources/human-pose.jpg',11 unmodified linesConducting inference with batch prompts is quite straightforward; just place them within a list structure:```pythonfrom lmdeploy import pipeline, TurbomindEngineConfig, ChatTemplateConfigfrom lmdeploy.vl import load_imagemodel = 'OpenGVLab/InternVL3-8B'pipe = pipeline(model, backend_config=TurbomindEngineConfig(session_len=16384, tp=1), chat_template_config=ChatTemplateConfig(model_name='internvl2_5'))image_urls=["https://raw.githubusercontent.com/open-mmlab/mmdeploy/main/demo/resources/human-pose.jpg",9 unmodified linesThere are two ways to do the multi-turn conversations with the pipeline. One is to construct messages according to the format of OpenAI and use above introduced method, the other is to use the `pipeline.chat` interface.```pythonfrom lmdeploy import pipeline, TurbomindEngineConfig, GenerationConfig, ChatTemplateConfigfrom lmdeploy.vl import load_imagemodel = 'OpenGVLab/InternVL3-8B'pipe = pipeline(model, backend_config=TurbomindEngineConfig(session_len=16384, tp=1), chat_template_config=ChatTemplateConfig(model_name='internvl2_5'))image = load_image('https://raw.githubusercontent.com/open-mmlab/mmdeploy/main/demo/resources/human-pose.jpg')gen_config = GenerationConfig(top_k=40, top_p=0.8, temperature=0.8)8 unmodified linesLMDeploy's `api_server` enables models to be easily packed into services with a single command. The provided RESTful APIs are compatible with OpenAI's interfaces. Below are an example of service startup:```shelllmdeploy serve api_server OpenGVLab/InternVL3-8B --chat-template internvl2_5 --server-port 23333 --tp 1```To use the OpenAI-style interface, you need to install OpenAI:
README.md+9-9