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

不使用lmdeploy和swift应该如何进行多图推理 #162

Open
aabbc-cell opened this issue May 10, 2024 · 3 comments
Open

不使用lmdeploy和swift应该如何进行多图推理 #162

aabbc-cell opened this issue May 10, 2024 · 3 comments

Comments

@aabbc-cell
Copy link

使用的代码是[https://huggingface.co/OpenGVLab/InternVL-Chat-V1-5] 中给的代码,并在多张v100上运行InternVL-Chat-V1-5

path = "./InternVL-Chat-V1-5"
model = AutoModel.from_pretrained(
    path,
    torch_dtype=torch.bfloat16,
    low_cpu_mem_usage=True,
    trust_remote_code=True,
    device_map='auto').eval()
tokenizer = AutoTokenizer.from_pretrained(path, trust_remote_code=True)
pixel_values = load_image('xxx.jpg', max_num=6).to(torch.bfloat16).cuda()

generation_config = dict(
    num_beams=1,
    max_new_tokens=512,
    do_sample=False,
)

# single-round single-image conversation
question = "describe this image"
response = model.chat(tokenizer, pixel_values, question, generation_config)

我希望能和[https://lmdeploy.readthedocs.io/zh-cn/latest/inference/vl_pipeline.html#id5]一样进行类似的多图推理,但lmdeploy不支持dp,我应该如何进行多图推理?

@BeiningWu
Copy link

the same question

@irexyc
Copy link

irexyc commented May 15, 2024

dp 是啥意思

@aabbc-cell
Copy link
Author

dp 是啥意思

data parallel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants