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

support Internvl chat v1.1, v1.2 and v1.2-plus #1425

Merged
merged 4 commits into from
Apr 16, 2024

Conversation

irexyc
Copy link
Collaborator

@irexyc irexyc commented Apr 11, 2024

Motivation

support

Modification

  • add chat template (internvl_zh)
  • add source model (InternVLModel)
  • add vision model (InternVLVisionModel)
  • add InternVLChatTemplateWrapper

Usage:

The vision model is big, so we need to reduce kv-cache in order to load the vision model on single gpu.

With 4 x A100, the memory usage is about 47G x 1 and 35G x 3 when using the following setting. (InternVL-Chat-Chinese-V1-2-Plus)

from lmdeploy import pipeline, TurbomindEngineConfig
from lmdeploy.vl import load_image

pipe = pipeline('/home/chenxin/InternVL-Chat-Chinese-V1-2-Plus/', log_level='INFO',
    backend_config=TurbomindEngineConfig(cache_max_entry_count=0.3, tp=4))

im = load_image('tiger.jpeg')
out = pipe(('描述这个图片', im))

TODO

The vision model is big compraed with qwen / llava which use about 12G gpu memory. I will make another PR to improve it.

lmdeploy/model.py Outdated Show resolved Hide resolved
lmdeploy/model.py Outdated Show resolved Hide resolved
@lvhan028
Copy link
Collaborator

supported_models.md,以及 readme中的模型支持列表,请更新

lmdeploy/model.py Outdated Show resolved Hide resolved
lmdeploy/model.py Outdated Show resolved Hide resolved
@lvhan028
Copy link
Collaborator

lvhan028 commented Apr 15, 2024

test with OpenGVLab/InternVL-Chat-Chinese-V1-2-Plus

  • pipeline (tp4)
  • gradio (tp4)
  • api_server (tp4)

Copy link
Collaborator

@AllentDan AllentDan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test with OpenGVLab/InternVL-Chat-Chinese-V1-1

  • pipeline (tp4 && tp8)
  • api_server (tp4)

@lvhan028 lvhan028 changed the title support Internvl chat support Internvl chat v1.1, v1.2 and v1.2-plus Apr 16, 2024
@lvhan028 lvhan028 merged commit 3b5795a into InternLM:main Apr 16, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants