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可以实现用DPO模型计算奖励的功能吗 #3056

Open
ghntd opened this issue Jan 20, 2025 · 2 comments
Open

lmdeploy可以实现用DPO模型计算奖励的功能吗 #3056

ghntd opened this issue Jan 20, 2025 · 2 comments
Assignees

Comments

@ghntd
Copy link
Contributor

ghntd commented Jan 20, 2025

我有一个用DPO训练的VLM,现在我想用它作为奖励模型来做一些探索。因此我希望可以给定模型一个完整的对话消息,模型应该返回所有输入的logits而不是对对话进行续写。如果可以实现的话,这将极大方便我的工作。

@lvhan028
Copy link
Collaborator

from lmdeploy import pipeline, GenerationConfig
from lmdeploy.vl import load_image
pipe = pipeline('OpenGVLab/InternVL2_5-8B')

image = load_image('https://raw.githubusercontent.com/open-mmlab/mmdeploy/main/tests/data/tiger.jpeg')

response = pipe(('describe this image', image),
                gen_config=GenerationConfig(output_logits='all', max_new_tokens=1))
logits = response.logits
print(logits)

看看这个符不符合你的需求?
需要用到 lmdeploy v0.7.0

@ghntd
Copy link
Contributor Author

ghntd commented Jan 20, 2025

太感谢了,这个功能对我来说太有用了

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

No branches or pull requests

2 participants