Skip to content

Commit b42b288

Browse files
committed
Support offical HF implementation and transformers > 5
Signed-off-by: Carles Onielfa <carlesonielfa@gmail.com>
1 parent 4bc4975 commit b42b288

5 files changed

Lines changed: 357 additions & 656 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ curl -LsSf https://astral.sh/uv/install.sh | sh
1717
```
1818
### From Git
1919

20-
Install using git as a package index:
20+
Install from git:
2121

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

example_florence2_usage.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,17 @@
55
This script demonstrates how to use Florence-2 models with vLLM
66
after installing the BART plugin.
77
"""
8-
import vllm_bart_plugin
8+
99
from vllm import LLM, SamplingParams
1010
from vllm.assets.image import ImageAsset
1111

1212

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

1817
llm = LLM(
1918
model=model_name,
20-
tokenizer=tokenizer_name,
2119
mm_processor_cache_gb=0,
2220
trust_remote_code=True,
2321
enforce_eager=True,

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ classifiers = [
2828
dependencies = [
2929
"vllm>=0.16.0",
3030
"torch>=2.9.0",
31-
"transformers>=4.56.0",
31+
"transformers>=4.56.0,<6",
3232
]
3333

3434
[project.optional-dependencies]

vllm_bart_plugin/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ def register_bart_model() -> None:
3434
"vllm_bart_plugin.florence2:Florence2ForConditionalGeneration",
3535
)
3636

37-
logger.info("Successfully registered BART model with vLLM")
37+
logger.info("Successfully registered BART and Florence2 models with vLLM")
3838

3939
except Exception as e:
40-
logger.error(f"Failed to register BART model: {e}")
40+
logger.error(f"Failed to register BART and Florence2 models: {e}")
4141
raise
4242

4343

0 commit comments

Comments
 (0)