Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Model] Initialize deepseek-vl support #5817

Open
wants to merge 66 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
4bd5aa9
[Model] Initialize deepseek-vl-7b-chat support
Jun 25, 2024
de63a4c
fix requirement for deepseek-vl
Jun 26, 2024
10b5cdd
Removed unused code, added documentation, added examples
Jun 26, 2024
0963337
Added test cases, deleted model dependencies, and optimized code
Jun 26, 2024
9752b0c
code reformat
Jun 27, 2024
de6879e
Remove timm dependency and Code Formatting
Jun 28, 2024
7cf0671
fix test failed
Jun 28, 2024
a26627a
Merge branch 'vllm-project:main' into deepseek-vl-7b-chat
liuyancong-enflame-tech Jun 28, 2024
d2d3eeb
Modify the deepseek-vl version number
Jun 28, 2024
23311f6
Delete failed test cases and dependencies to resolve conflicts
Jul 1, 2024
152059f
Merge branch 'vllm-project:main' into deepseek-vl-7b-chat
liuyancong-enflame-tech Jul 1, 2024
89d7856
resolve conflicts
Jul 1, 2024
1eb7d48
fix code bug
Jul 1, 2024
0f127c6
fix error Line too long
Jul 1, 2024
32afabf
Merge branch 'vllm-project:main' into deepseek-vl-7b-chat
liuyancong-enflame-tech Jul 2, 2024
7861261
add test case and fix update
Jul 2, 2024
9b2e116
uodate test case
Jul 2, 2024
80533ea
uodate test case and fix test bugs
Jul 2, 2024
2aa76b6
Merge branch 'vllm-project:main' into deepseek-vl-7b-chat
liuyancong-enflame-tech Jul 2, 2024
92c8084
update test case and fix bugs
Jul 3, 2024
eb12478
Merge branch 'vllm-project:main' into deepseek-vl-7b-chat
liuyancong-enflame-tech Jul 3, 2024
d6452bb
update test example
Jul 3, 2024
f63a1a1
fix test case
Jul 3, 2024
1b90f47
Adaptation code update
Jul 3, 2024
7f8ed9d
Merge branch 'vllm-project:main' into deepseek-vl-7b-chat
liuyancong-enflame-tech Jul 3, 2024
0e93474
Merge branch 'vllm-project:main' into deepseek-vl-7b-chat
liuyancong-enflame-tech Jul 4, 2024
76f49b9
Merge branch 'vllm-project:main' into deepseek-vl-7b-chat
liuyancong-enflame-tech Jul 4, 2024
026c92f
Adaptation code update
Jul 4, 2024
ffa1cc7
Update Test case
Jul 5, 2024
1771172
fix Test case
Jul 5, 2024
9287c7d
Update Test case
Jul 5, 2024
9845ced
Merge branch 'vllm-project:main' into deepseek-vl-7b-chat
liuyancong-enflame-tech Jul 5, 2024
5ff27a6
Add register_max_image_tokens
Jul 5, 2024
6c41130
fix test case
Jul 5, 2024
0e1bc5b
fix test case
Jul 5, 2024
a321360
Merge branch 'vllm-project:main' into deepseek-vl-7b-chat
liuyancong-enflame-tech Jul 8, 2024
3b3b8ec
fix test dtype error
Jul 8, 2024
9383b22
Merge branch 'deepseek-vl-7b-chat' of github.com:liuyancong-enflame-t…
Jul 8, 2024
f2f29d1
fix test dtype error
Jul 8, 2024
03133bb
update doc and fix test error
Jul 8, 2024
ff6c758
fix mypy error
Jul 8, 2024
e631e42
Merge branch 'vllm-project:main' into deepseek-vl-7b-chat
liuyancong-enflame-tech Jul 9, 2024
9d1f68e
use 1.3b model
Jul 9, 2024
2025c39
use 1.3b model
Jul 9, 2024
773aec8
use 1.3b model
Jul 9, 2024
ee5a3db
use 1.3b model
Jul 9, 2024
71ea404
use gpu
Jul 9, 2024
48862ca
use gpu
Jul 9, 2024
348064a
fix Conflicting files and update test
Jul 12, 2024
e3569ef
Merge branch 'main' into deepseek-vl-7b-chat
liuyancong-enflame-tech Jul 12, 2024
0748ce4
update test
Jul 12, 2024
aa5edac
Merge branch 'vllm-project:main' into deepseek-vl-7b-chat
liuyancong-enflame-tech Jul 15, 2024
a063b71
update test
Jul 15, 2024
8be4a36
update test
Jul 15, 2024
c105475
fix test failed
Jul 16, 2024
5378c10
fix test failed
Jul 16, 2024
577a382
Merge branch 'vllm-project:main' into deepseek-vl-7b-chat
liuyancong-enflame-tech Jul 16, 2024
77d5715
Merge branch 'vllm-project:main' into deepseek-vl-7b-chat
liuyancong-enflame-tech Jul 17, 2024
e6d1aeb
update example
Jul 18, 2024
bbef748
update example
Jul 18, 2024
9c054f2
Merge branch 'main' into deepseek-vl-7b-chat
liuyancong-enflame-tech Jul 22, 2024
3552c03
fix ruff error
Jul 22, 2024
26482e8
Merge branch 'deepseek-vl-7b-chat' of github.com:liuyancong-enflame-t…
Jul 22, 2024
d615870
fix conflict
Jul 25, 2024
cd01465
Merge branch 'main' into deepseek-vl-7b-chat
liuyancong-enflame-tech Jul 25, 2024
f48ba9b
delete useless code
Jul 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion docs/source/models/supported_models.rst
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,10 @@ Vision Language Models
- MiniCPM-V
- :code:`openbmb/MiniCPM-V-2`, :code:`openbmb/MiniCPM-Llama3-V-2_5`, etc.
-
* - :code:`DeepSeekMultiModalityCausalLM`
- deepseek-ai
- :code:`deepseek-ai/deepseek-vl-1.3b-chat`, :code:`deepseek-ai/deepseek-vl-7b-chat`, etc.
-

If your model uses one of the above model architectures, you can seamlessly run your model with vLLM.
Otherwise, please refer to :ref:`Adding a New Model <adding_a_new_model>` and :ref:`Enabling Multimodal Inputs <enabling_multimodal_inputs>`
Expand Down Expand Up @@ -271,4 +275,4 @@ We have the following levels of testing for models:
1. **Strict Consistency**: We compare the output of the model with the output of the model in the HuggingFace Transformers library under greedy decoding. This is the most stringent test. Please refer to `test_models.py <https://github.com/vllm-project/vllm/blob/main/tests/models/test_models.py>`_ and `test_big_models.py <https://github.com/vllm-project/vllm/blob/main/tests/models/test_big_models.py>`_ for the models that have passed this test.
2. **Output Sensibility**: We check if the output of the model is sensible and coherent, by measuring the perplexity of the output and checking for any obvious errors. This is a less stringent test.
3. **Runtime Functionality**: We check if the model can be loaded and run without errors. This is the least stringent test. Please refer to `functionality tests <https://github.com/vllm-project/vllm/tree/main/tests>`_ and `examples <https://github.com/vllm-project/vllm/tree/main/examples>`_ for the models that have passed this test.
4. **Community Feedback**: We rely on the community to provide feedback on the models. If a model is broken or not working as expected, we encourage users to raise issues to report it or open pull requests to fix it. The rest of the models fall under this category.
4. **Community Feedback**: We rely on the community to provide feedback on the models. If a model is broken or not working as expected, we encourage users to raise issues to report it or open pull requests to fix it. The rest of the models fall under this category.
54 changes: 54 additions & 0 deletions examples/deepseek_vl_example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
from vllm import LLM, SamplingParams
from vllm.assets.image import ImageAsset

sample_params = SamplingParams(temperature=0, max_tokens=1024)
model = "deepseek-ai/deepseek-vl-7b-chat"
model = "deepseek-ai/deepseek-vl-1.3b-chat"
prompt_one = (
"You are a helpful language and vision assistant."
"You are able to understand the visual content that the user provides,"
"and assist the user with a variety of tasks using natural language.\n"
"User: <image_placeholder> Describe the content of this image.\nAssistant:"
)

prompt_two = (
"You are a helpful language and vision assistant. You are able to "
"understand the visual content that the user provides, and assist the "
"user with a variety of tasks using natural language.\n User: "
"<image_placeholder>What is the season?\nAssistant:")


def run_deepseek_vl():
llm = LLM(model=model)
stop_sign_image = ImageAsset("stop_sign").pil_image
cherry_blossom_image = ImageAsset("cherry_blossom").pil_image
outputs = llm.generate(
[
{
"prompt": prompt_one,
"multi_modal_data": {
"image": stop_sign_image
},
},
{
"prompt": prompt_two,
"multi_modal_data": {
"image": cherry_blossom_image
},
},
],
sampling_params=sample_params,
)

for o in outputs:
generated_text = o.outputs[0].text
print("------------------")
print(generated_text)


def main():
run_deepseek_vl()


if __name__ == "__main__":
main()
2 changes: 1 addition & 1 deletion tests/entrypoints/openai/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@ def sample_sql_statements():
table: "table_1" | "table_2"
condition: column "=" number
number: "1" | "2"
""")
""")
Loading
Loading