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

多轮对话批处理耗时异常 #1901

Open
SunnyLee20230523 opened this issue Jul 3, 2024 · 2 comments
Open

多轮对话批处理耗时异常 #1901

SunnyLee20230523 opened this issue Jul 3, 2024 · 2 comments

Comments

@SunnyLee20230523
Copy link

作者大大您好,我在使用DeepSeek-vl-7B多轮对话:第一轮中的第一张图作为one-shot案例,然后第二轮的第二张图需要模型根据第一轮的example进行描述。在这个过程中,大概耗时2-5秒,属于合理范围。如下:
6bff08173ab0f470fb663d2ea9cf0fc8

然后我将这个[prompt] * 512,即变成批次处理,大概耗时250多秒,如下:
70d58b9aefa85375d96ff2574bdb91d0

但是,问题来了,我处理不同的512张图片时,即第二轮需要模型生成的内容中,一个批次512个采用了512张图片,生成速度却异常慢,如下:
0fa7a5fbb66792d77ff8c0c7b2b989ff

请问这是多轮推理效率的问题吗还是其他原因呢?

@SunnyLee20230523
Copy link
Author

user_input_dict = {
'role': 'user',
'content': [
{'type': 'text', 'text': user_input},
{'type': 'image_url', 'image_url': {'url': user_image}}
]
}
prompts.append(user_input_dict)
response = pipe([prompts,....,prompts], gen_config=gen_config)
这是第二轮对话的样例,我的一个批次512个,每个对话中的user_image都不一样时,推理就会异常,耗时很长

@SunnyLee20230523
Copy link
Author

还有一个问题就是:如果我在一个对话中使用了两张图片,模型是否可以辨别第一张图、第二张图的位置?

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

1 participant