Image-Text-to-Text
Transformers
Safetensors
qwen3_5
qwen3.5
video
video-captioning
data-engine
conversational
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
Download SOURCE_MANIFEST.sha256 from nvidia/Flora-Captioner: direct link, hf CLI and curl.
- Browser
- Download file 1.86 kB
-
https://huggingface.co/nvidia/Flora-Captioner/resolve/main/SOURCE_MANIFEST.sha256
- Command line
-
hf download hf://nvidia/Flora-Captioner/SOURCE_MANIFEST.sha256
-
curl -L -o SOURCE_MANIFEST.sha256 https://huggingface.co/nvidia/Flora-Captioner/resolve/main/SOURCE_MANIFEST.sha256
1.86 kB
| b1979e729def7828c8d7600692ba17a3913bdac6ddd152c22bfcabd3f0ad924e MODEL_PROVENANCE.json | |
| 04f9f4ba0d25e61a87e77c111a4c233da1baa7ecf459ebc5d49652a66ea3bb64 README.md | |
| d28ca68768ac2ce0ad42eaaf54d5bac4f8a298f7d017f5a04f3866094c65a839 chat_template.jinja | |
| 81ac7cb6c4b9d01e4232891cd9c0cd041f7e3270b342f7641eb7043a345e98af config.json | |
| fb58199b78abc0e3c284d170ecddf488501ca9fe91d9e435d6801f85b1a50ff0 generation_config.json | |
| 0f4d9f912a24d0912379daea0d83eac5dc63a454843e8a3b22ee3ec10ff1dde7 model-00001-of-00011.safetensors | |
| 7e10584c66eadea47103516e24613a4dc565633327632b938650f2a8645fb993 model-00002-of-00011.safetensors | |
| 38681bea96f265c5ea5d24b8eea36a3b84f396e7debbba471038a32b0d862863 model-00003-of-00011.safetensors | |
| 4decbc89be8bedfc998579c353a4e98565b647353bfdf4423e5a2a4779d4e38f model-00004-of-00011.safetensors | |
| 4d560b69491ed1831ce4b82176b181fab1409079bed3c4f91073126c03ca25a8 model-00005-of-00011.safetensors | |
| 6f854df027e3c636a21d10d18c92c7d316a831544cef173e4ffccfc4dc0bb010 model-00006-of-00011.safetensors | |
| bedeafd96cf120d63e75b6334b43b50505a4201184fcec6b37c842eaaad22f4a model-00007-of-00011.safetensors | |
| 205b635a10cc6104adb1f3cd77bd1328dad0caa9213d57b9f2e14901f4eed7fb model-00008-of-00011.safetensors | |
| 9562cd68bfe99f1a3c08ff4f2e59c7b5dcb1fe89bc7259f875b5b5d3e750c3c8 model-00009-of-00011.safetensors | |
| accf251611ff0f638c7203df47953312618c489f3926e3435d74c53a7ee00727 model-00010-of-00011.safetensors | |
| 89abf58cc40ff45f4871e00ff1eef61113fe07e3169bf0d6762b9774aae623db model-00011-of-00011.safetensors | |
| 07bf5bc06f86a364da4422c25e6a979c8457136a4645399904d90af2e9703142 model.safetensors.index.json | |
| e4922da7a64698c34f0c16ee78b55b43709b77a9e48da6ae07eda4bf7e6e236d processor_config.json | |
| 06b9509352d2af50381ab2247e083b80d32d5c0aba91c272ca9ff729b6a0e523 tokenizer.json | |
| b4c4e0a37983a58c329c8c4e25d59f3305fd344815f4ecb8c66a99323a254cf8 tokenizer_config.json | |