-
-
Notifications
You must be signed in to change notification settings - Fork 12.6k
[Model] Initialize deepseek-vl support #5817
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
Closed
liuyancong-enflame-tech
wants to merge
66
commits into
vllm-project:main
from
liuyancong-enflame-tech:deepseek-vl-7b-chat
Closed
Changes from 58 commits
Commits
Show all changes
66 commits
Select commit
Hold shift + click to select a range
4bd5aa9
[Model] Initialize deepseek-vl-7b-chat support
de63a4c
fix requirement for deepseek-vl
10b5cdd
Removed unused code, added documentation, added examples
0963337
Added test cases, deleted model dependencies, and optimized code
9752b0c
code reformat
de6879e
Remove timm dependency and Code Formatting
7cf0671
fix test failed
a26627a
Merge branch 'vllm-project:main' into deepseek-vl-7b-chat
liuyancong-enflame-tech d2d3eeb
Modify the deepseek-vl version number
23311f6
Delete failed test cases and dependencies to resolve conflicts
152059f
Merge branch 'vllm-project:main' into deepseek-vl-7b-chat
liuyancong-enflame-tech 89d7856
resolve conflicts
1eb7d48
fix code bug
0f127c6
fix error Line too long
32afabf
Merge branch 'vllm-project:main' into deepseek-vl-7b-chat
liuyancong-enflame-tech 7861261
add test case and fix update
9b2e116
uodate test case
80533ea
uodate test case and fix test bugs
2aa76b6
Merge branch 'vllm-project:main' into deepseek-vl-7b-chat
liuyancong-enflame-tech 92c8084
update test case and fix bugs
eb12478
Merge branch 'vllm-project:main' into deepseek-vl-7b-chat
liuyancong-enflame-tech d6452bb
update test example
f63a1a1
fix test case
1b90f47
Adaptation code update
7f8ed9d
Merge branch 'vllm-project:main' into deepseek-vl-7b-chat
liuyancong-enflame-tech 0e93474
Merge branch 'vllm-project:main' into deepseek-vl-7b-chat
liuyancong-enflame-tech 76f49b9
Merge branch 'vllm-project:main' into deepseek-vl-7b-chat
liuyancong-enflame-tech 026c92f
Adaptation code update
ffa1cc7
Update Test case
1771172
fix Test case
9287c7d
Update Test case
9845ced
Merge branch 'vllm-project:main' into deepseek-vl-7b-chat
liuyancong-enflame-tech 5ff27a6
Add register_max_image_tokens
6c41130
fix test case
0e1bc5b
fix test case
a321360
Merge branch 'vllm-project:main' into deepseek-vl-7b-chat
liuyancong-enflame-tech 3b3b8ec
fix test dtype error
9383b22
Merge branch 'deepseek-vl-7b-chat' of github.com:liuyancong-enflame-t…
f2f29d1
fix test dtype error
03133bb
update doc and fix test error
ff6c758
fix mypy error
e631e42
Merge branch 'vllm-project:main' into deepseek-vl-7b-chat
liuyancong-enflame-tech 9d1f68e
use 1.3b model
2025c39
use 1.3b model
773aec8
use 1.3b model
ee5a3db
use 1.3b model
71ea404
use gpu
48862ca
use gpu
348064a
fix Conflicting files and update test
e3569ef
Merge branch 'main' into deepseek-vl-7b-chat
liuyancong-enflame-tech 0748ce4
update test
aa5edac
Merge branch 'vllm-project:main' into deepseek-vl-7b-chat
liuyancong-enflame-tech a063b71
update test
8be4a36
update test
c105475
fix test failed
5378c10
fix test failed
577a382
Merge branch 'vllm-project:main' into deepseek-vl-7b-chat
liuyancong-enflame-tech 77d5715
Merge branch 'vllm-project:main' into deepseek-vl-7b-chat
liuyancong-enflame-tech e6d1aeb
update example
bbef748
update example
9c054f2
Merge branch 'main' into deepseek-vl-7b-chat
liuyancong-enflame-tech 3552c03
fix ruff error
26482e8
Merge branch 'deepseek-vl-7b-chat' of github.com:liuyancong-enflame-t…
d615870
fix conflict
cd01465
Merge branch 'main' into deepseek-vl-7b-chat
liuyancong-enflame-tech f48ba9b
delete useless code
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| import os | ||
| import subprocess | ||
|
|
||
| import torch | ||
| from PIL import Image | ||
|
|
||
| # The assets are located at `s3://air-example-data-2/vllm_opensource_llava/`. | ||
| # You can use `.buildkite/download-images.sh` to download them | ||
| from vllm import LLM, SamplingParams | ||
|
|
||
| sample_params = SamplingParams(temperature=0, max_tokens=1024) | ||
| model = "deepseek-ai/deepseek-vl-7b-chat" | ||
| model = "deepseek-ai/deepseek-vl-1.3b-chat" | ||
| prompt = "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:" | ||
|
|
||
|
|
||
| def run_deepseek_vl(): | ||
| llm = LLM(model=model, | ||
| max_model_len=3072, | ||
| enforce_eager=True, | ||
| dtype=torch.bfloat16) | ||
|
|
||
| image = Image.open("images/stop_sign.jpg") | ||
|
|
||
| outputs = llm.generate( | ||
| { | ||
| "prompt": prompt, | ||
| "multi_modal_data": { | ||
| "image": image | ||
| }, | ||
| }, | ||
| sampling_params=sample_params) | ||
|
|
||
| for o in outputs: | ||
| generated_text = o.outputs[0].text | ||
| print(generated_text) | ||
|
|
||
|
|
||
| def main(): | ||
| run_deepseek_vl() | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| # Download from s3 | ||
| s3_bucket_path = "s3://air-example-data-2/vllm_opensource_llava/" | ||
| local_directory = "images" | ||
|
|
||
| # Make sure the local directory exists or create it | ||
| os.makedirs(local_directory, exist_ok=True) | ||
|
|
||
| # Use AWS CLI to sync the directory, assume anonymous access | ||
| subprocess.check_call([ | ||
| "aws", | ||
| "s3", | ||
| "sync", | ||
| s3_bucket_path, | ||
| local_directory, | ||
| "--no-sign-request", | ||
| ]) | ||
| main() | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.