Image-Text-to-Text
Transformers
Safetensors
English
Chinese
bard_vl
text-generation
Bard-VL
VLM
vision-language
multimodal
discrete-diffusion
masked-decoding
custom_code
conversational
Instructions to use fudan-generative-ai/Bard-VL-B8-Mask-4B-Distil-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use fudan-generative-ai/Bard-VL-B8-Mask-4B-Distil-Instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="fudan-generative-ai/Bard-VL-B8-Mask-4B-Distil-Instruct", 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 AutoModelForSeq2SeqLM model = AutoModelForSeq2SeqLM.from_pretrained("fudan-generative-ai/Bard-VL-B8-Mask-4B-Distil-Instruct", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use fudan-generative-ai/Bard-VL-B8-Mask-4B-Distil-Instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "fudan-generative-ai/Bard-VL-B8-Mask-4B-Distil-Instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "fudan-generative-ai/Bard-VL-B8-Mask-4B-Distil-Instruct", "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/fudan-generative-ai/Bard-VL-B8-Mask-4B-Distil-Instruct
- SGLang
How to use fudan-generative-ai/Bard-VL-B8-Mask-4B-Distil-Instruct 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 "fudan-generative-ai/Bard-VL-B8-Mask-4B-Distil-Instruct" \ --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": "fudan-generative-ai/Bard-VL-B8-Mask-4B-Distil-Instruct", "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 "fudan-generative-ai/Bard-VL-B8-Mask-4B-Distil-Instruct" \ --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": "fudan-generative-ai/Bard-VL-B8-Mask-4B-Distil-Instruct", "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 fudan-generative-ai/Bard-VL-B8-Mask-4B-Distil-Instruct with Docker Model Runner:
docker model run hf.co/fudan-generative-ai/Bard-VL-B8-Mask-4B-Distil-Instruct
Add model card for BARD-VL
#4
by nielsr HF Staff - opened
README.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
pipeline_tag: image-text-to-text
|
| 3 |
+
---
|
| 4 |
+
|
| 5 |
+
# BARD-VL
|
| 6 |
+
|
| 7 |
+
BARD (Bridging AutoRegressive and Diffusion) is a framework that converts a pretrained autoregressive vision-language model (VLM) into a decoding-efficient diffusion VLM (dVLM). By using progressive supervised block merging and stage-wise distillation, BARD-VL achieves significant decoding throughput speedups (up to 3$\times$) compared to the source autoregressive models while maintaining high quality in multimodal tasks.
|
| 8 |
+
|
| 9 |
+
- **Paper:** [BARD: Bridging AutoRegressive and Diffusion Vision-Language Models Via Highly Efficient Progressive Block Merging and Stage-Wise Distillation](https://huggingface.co/papers/2604.16514)
|
| 10 |
+
- **Repository:** [https://github.com/fudan-generative-vision/Bard-VL](https://github.com/fudan-generative-vision/Bard-VL)
|
| 11 |
+
- **Project Page:** [https://fudan-generative-vision.github.io/Bard-VL](https://fudan-generative-vision.github.io/Bard-VL)
|
| 12 |
+
|
| 13 |
+
## Method Overview
|
| 14 |
+
|
| 15 |
+
The BARD framework introduces two main stages to bridge the gap between autoregressive and diffusion paradigms:
|
| 16 |
+
1. **Progressive Block Merging (PBM):** Gradually enlarges the decoding block size.
|
| 17 |
+
2. **Stage-Wise Distillation (SWD):** Intra-dVLM distillation from a fixed small-block diffusion anchor to recover performance lost at larger blocks.
|
| 18 |
+
|
| 19 |
+
## Usage
|
| 20 |
+
|
| 21 |
+
To use BARD-VL, please clone the [official repository](https://github.com/fudan-generative-vision/Bard-VL) and follow the installation instructions. You can then run inference for image and video understanding using the provided `inference.py` script:
|
| 22 |
+
|
| 23 |
+
```bash
|
| 24 |
+
python3 inference.py \
|
| 25 |
+
--model_id <path_to_model_checkpoint> \
|
| 26 |
+
--block_size 4 \
|
| 27 |
+
--denoising_steps 4 \
|
| 28 |
+
--confidence_threshold 0.6
|
| 29 |
+
```
|
| 30 |
+
|
| 31 |
+
## Citation
|
| 32 |
+
|
| 33 |
+
If you find BARD-VL useful in your research, please cite the following paper:
|
| 34 |
+
|
| 35 |
+
```bibtex
|
| 36 |
+
@article{chen2026bard,
|
| 37 |
+
title={BARD: Bridging AutoRegressive and Diffusion Vision-Language Models Via Highly Efficient Progressive Block Merging and Stage-Wise Distillation},
|
| 38 |
+
author={Chen, Baoyou and Xia, Hanchen and Tu, Peng and Shi, Haojun and Mu, Shan and Yuan, Weihao and Zhu, Siyu},
|
| 39 |
+
journal={arXiv preprint arXiv:2604.16514},
|
| 40 |
+
year={2026}
|
| 41 |
+
}
|
| 42 |
+
```
|
| 43 |
+
|
| 44 |
+
## Acknowledgements
|
| 45 |
+
|
| 46 |
+
This project builds on top of [NVIDIA NeMo AutoModel](https://github.com/NVIDIA-NeMo/Automodel).
|