Image-Text-to-Text
Transformers
Safetensors
qwen3_5
qwen3.5
video
video-captioning
data-engine
conversational
Run this model with HF Jobs
Run nvidia/Flora-Captioner 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/nvidia/Flora-Captioner. 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/nvidia/Flora-Captioner 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/nvidia/Flora-Captioner. 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/nvidia/Flora-Captioner. 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 nvidia/Flora-Captioner with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use nvidia/Flora-Captioner with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="nvidia/Flora-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)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("nvidia/Flora-Captioner") model = AutoModelForMultimodalLM.from_pretrained("nvidia/Flora-Captioner", device_map="auto") 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=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use nvidia/Flora-Captioner with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "nvidia/Flora-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": "nvidia/Flora-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/nvidia/Flora-Captioner
- SGLang
How to use nvidia/Flora-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 "nvidia/Flora-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": "nvidia/Flora-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 "nvidia/Flora-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": "nvidia/Flora-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 nvidia/Flora-Captioner with Docker Model Runner:
docker model run hf.co/nvidia/Flora-Captioner
Omar L commited on
Commit ·
f736ca3
1
Parent(s): 00c7586
Document third-party inference dependencies (#2)
Browse files- Document third-party inference dependencies (e3a967781167c1ecca76956d9409e4c48f87f70a)
Files changed (3)
1234545678158 unmodified lines167168169170171172173174175176{ "files": { "batch_utils/README.md": { "bytes": 4125, "sha256": "f9a9dd0a67b914bb1304a53674c03deec9f6a9aaa580781a13d88b365284a65c" "bytes": 4337, "sha256": "f03e4f204b906db2b11a447585e09b6e01af5129a88b9123a5066087309f3007" }, "batch_utils/__init__.py": { "bytes": 91,158 unmodified lines "infer.py": { "bytes": 171, "sha256": "8cddbb43ba5b9d884e8f771b9c9e219ce2e0a3c1d71a94a75d02b1d3b730f93d" }, "batch_utils/THIRD_PARTY_NOTICES.md": { "bytes": 1497, "sha256": "b73d47aa224b69e8c97850912c23d8b29219126568a11fa41ee3d085a8a430a3" } }, "schema_version": "flora_inference_code_manifest_v1"7 unmodified lines891011121314157 unmodified lines
## Setup
This project will download and install additional third-party open source software projects. Review the license terms of these open source projects before use. See [third-party notices](THIRD_PARTY_NOTICES.md).
Python 3.12 and a CUDA GPU with 80 GB VRAM are the validated configuration.The two models run sequentially. Download/cache space of at least 150 GB isrecommended for the released FP32 Captioner, base model, and adapter.123456789101112131415161718# Third-party notices
The inference scripts use the packages below, installed separately by the setup commands. These packages are not bundled in this repository. The requirements match [requirements.txt](requirements.txt).
The links identify upstream project licenses. Installed distributions and their dependencies retain their own licenses and notices. For version ranges, consult the license files supplied with the installed version.
| Requirement | Upstream license || --- | --- || `torch==2.11.0` | [BSD-3-Clause](https://github.com/pytorch/pytorch/blob/v2.11.0/LICENSE) || `torchvision==0.26.0` | [BSD-3-Clause](https://github.com/pytorch/vision/blob/v0.26.0/LICENSE) || `huggingface_hub==1.33.0` | [Apache-2.0](https://github.com/huggingface/huggingface_hub/blob/v1.33.0/LICENSE) || `transformers==5.8.1` | [Apache-2.0](https://github.com/huggingface/transformers/blob/v5.8.1/LICENSE) || `peft==0.18.1` | [Apache-2.0](https://github.com/huggingface/peft/blob/v0.18.1/LICENSE) || `accelerate==1.12.0` | [Apache-2.0](https://github.com/huggingface/accelerate/blob/v1.12.0/LICENSE) || `safetensors==0.7.0` | [Apache-2.0](https://github.com/huggingface/safetensors/blob/v0.7.0/LICENSE) || `av==16.0.1` | [BSD-3-Clause](https://github.com/PyAV-Org/PyAV/blob/v16.0.1/LICENSE.txt) || `numpy<3` | [BSD-3-Clause](https://github.com/numpy/numpy/blob/main/LICENSE.txt) || `Pillow>=11,<13` | [PIL Software License (MIT-CMU)](https://github.com/python-pillow/Pillow/blob/main/LICENSE) |batch_utils/CODE_MANIFEST.json+6-2
batch_utils/README.md+2
batch_utils/THIRD_PARTY_NOTICES.mdAdded+18