Image-Text-to-Text
Transformers
Safetensors
internvl
llama-factory
full
Generated from Trainer
conversational
Instructions to use LibraCaption/InternVL3-38B-Captioner with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use LibraCaption/InternVL3-38B-Captioner with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="LibraCaption/InternVL3-38B-Captioner") 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 AutoProcessor, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("LibraCaption/InternVL3-38B-Captioner") model = AutoModelForImageTextToText.from_pretrained("LibraCaption/InternVL3-38B-Captioner") 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?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use LibraCaption/InternVL3-38B-Captioner with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "LibraCaption/InternVL3-38B-Captioner" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "LibraCaption/InternVL3-38B-Captioner", "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/LibraCaption/InternVL3-38B-Captioner
- SGLang
How to use LibraCaption/InternVL3-38B-Captioner 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 "LibraCaption/InternVL3-38B-Captioner" \ --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": "LibraCaption/InternVL3-38B-Captioner", "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 "LibraCaption/InternVL3-38B-Captioner" \ --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": "LibraCaption/InternVL3-38B-Captioner", "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 LibraCaption/InternVL3-38B-Captioner with Docker Model Runner:
docker model run hf.co/LibraCaption/InternVL3-38B-Captioner
sft_captioner
This model is a fine-tuned version of OpenGVLab/InternVL3-38B-hf on the pyq_part1_captioner_0815, the pyq_part2_captioner_0815 and the private_captioner_0815_optimized.json datasets. It achieves the following results on the evaluation set:
- Loss: 0.7323
Model description
More information needed
Intended uses & limitations
More information needed
Training and evaluation data
More information needed
Training procedure
Training hyperparameters
The following hyperparameters were used during training:
- learning_rate: 1e-05
- train_batch_size: 4
- eval_batch_size: 4
- seed: 2025
- distributed_type: multi-GPU
- num_devices: 8
- total_train_batch_size: 32
- total_eval_batch_size: 32
- optimizer: Use adamw_torch with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
- lr_scheduler_type: cosine
- lr_scheduler_warmup_ratio: 0.1
- num_epochs: 2.0
Training results
| Training Loss | Epoch | Step | Validation Loss |
|---|---|---|---|
| 0.8966 | 0.0868 | 500 | 0.8954 |
| 0.861 | 0.1735 | 1000 | 0.8705 |
| 0.8622 | 0.2603 | 1500 | 0.8549 |
| 0.82 | 0.3470 | 2000 | 0.8349 |
| 0.8211 | 0.4338 | 2500 | 0.8202 |
| 0.7978 | 0.5206 | 3000 | 0.8064 |
| 0.7955 | 0.6073 | 3500 | 0.7945 |
| 0.7845 | 0.6941 | 4000 | 0.7838 |
| 0.7617 | 0.7808 | 4500 | 0.7729 |
| 0.7772 | 0.8676 | 5000 | 0.7622 |
| 0.7641 | 0.9544 | 5500 | 0.7544 |
| 0.6061 | 1.0411 | 6000 | 0.7635 |
| 0.5863 | 1.1279 | 6500 | 0.7613 |
| 0.5777 | 1.2146 | 7000 | 0.7588 |
| 0.5943 | 1.3014 | 7500 | 0.7490 |
| 0.5816 | 1.3882 | 8000 | 0.7469 |
| 0.5723 | 1.4749 | 8500 | 0.7421 |
| 0.5721 | 1.5617 | 9000 | 0.7374 |
| 0.5724 | 1.6484 | 9500 | 0.7353 |
| 0.5731 | 1.7352 | 10000 | 0.7343 |
| 0.5597 | 1.8220 | 10500 | 0.7330 |
| 0.5731 | 1.9087 | 11000 | 0.7326 |
| 0.5557 | 1.9955 | 11500 | 0.7323 |
Framework versions
- Transformers 4.52.4
- Pytorch 2.7.1+cu126
- Datasets 3.6.0
- Tokenizers 0.21.1
- Downloads last month
- 22
Model tree for LibraCaption/InternVL3-38B-Captioner
Base model
OpenGVLab/InternVL3-38B-Pretrained Finetuned
OpenGVLab/InternVL3-38B-Instruct Finetuned
OpenGVLab/InternVL3-38B-hf