Skip to content
Open
20 changes: 15 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ This plugin requires [uv](https://docs.astral.sh/uv/) for package management. If
```bash
curl -LsSf https://astral.sh/uv/install.sh | sh
```
### From Git

Install from git:

```bash
pip install git+https://github.com/vllm-project/bart-plugin
```

### From Source

Expand Down Expand Up @@ -186,11 +193,14 @@ Notes:
```
bart-plugin/
├── vllm_bart_plugin/
│ ├── __init__.py # Plugin registration
│ └── bart.py # BART model implementation
├── setup.py # Package configuration and entry points
├── README.md # This file
└── LICENSE # License file
│ ├── __init__.py # Plugin registration
│ └── bart.py # BART model implementation
│ └── florence2.py # Florence-2 model implementation
├── setup.py # Package configuration and entry points
├── README.md # This file
└── LICENSE # License file
└── example_bart_usage.py # Example usage script for BART
└── example_florence2_usage.py # Example usage script for Florence-2
```

### Running Tests
Expand Down
11 changes: 3 additions & 8 deletions example_florence2_usage.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,23 @@
This script demonstrates how to use Florence-2 models with vLLM
after installing the BART plugin.
"""
import vllm_bart_plugin

from vllm import LLM, SamplingParams
from vllm.assets.image import ImageAsset


def main():
"""Run Florence-2 model examples."""
model_name = "microsoft/Florence-2-large"
tokenizer_name = "Isotr0py/Florence-2-tokenizer"
model_name = "florence-community/Florence-2-large-ft"

llm = LLM(
model=model_name,
tokenizer=tokenizer_name,
mm_processor_cache_gb=0,
trust_remote_code=True,
enforce_eager=True,
)
params = SamplingParams(
temperature=0.0,
max_tokens=20,
# repetition_penalty is needed to prevent <s> repetition
repetition_penalty=1.5,
# skip_special_tokens=False is needed to present
# grounding tokens like <loc_0><loc_1>
skip_special_tokens=False,
Expand Down Expand Up @@ -60,4 +55,4 @@ def main():


if __name__ == "__main__":
main()
main()
18 changes: 15 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "vllm-bart-plugin"
version = "0.2.0"
version = "0.3.0"
description = "BART model plugin for vLLM"
readme = "README.md"
requires-python = ">=3.10"
Expand All @@ -26,9 +26,9 @@ classifiers = [
]

dependencies = [
"vllm>=0.14.0",
"vllm>=0.16.0",
"torch>=2.9.0",
"transformers>=4.56.0,<5",
"transformers>=4.56.0,<6",
]

[project.optional-dependencies]
Expand Down Expand Up @@ -62,8 +62,20 @@ include = '\.pyi?$'
profile = "black"
line_length = 88

[tool.pytest.ini_options]
markers = [
"slow: marks tests requiring a GPU and full model download (deselect with '-m \"not slow\"')",
]

[tool.mypy]
python_version = "3.10"
warn_return_any = true
warn_unused_configs = true
ignore_missing_imports = true

[dependency-groups]
dev = [
"black>=26.1.0",
"isort>=8.0.1",
"pytest>=9.0.2",
]
Loading