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

[Feature]: Output logps of given output #8622

Open
1 task done
lycheeyolo opened this issue Sep 19, 2024 · 3 comments
Open
1 task done

[Feature]: Output logps of given output #8622

lycheeyolo opened this issue Sep 19, 2024 · 3 comments

Comments

@lycheeyolo
Copy link

🚀 The feature, motivation and pitch

vllm is a great project. and i have meet the problem that how could i acquire the logps of a given input and output?
for example, when the question is "who are you?", i want acquire the logps of answer "i am GPT model". i could not find any functions to realize this issue.

Alternatives

No response

Additional context

No response

Before submitting a new issue...

  • Make sure you already searched for relevant issues, and asked the chatbot living at the bottom right corner of the documentation page, which can answer lots of frequently asked questions.
@DarkLight1337
Copy link
Member

DarkLight1337 commented Sep 19, 2024

You can pass sampling_params=SamplingParams(prompt_logprobs=...) for offline inference. A corresponding option is also available for online inference, please read the docs.

@lycheeyolo
Copy link
Author

it seems like not fit this problem. when i ask the LLM that "who are you?", i want it output the logps of the answer "i am GPT model". and the "i am GPT model" what i expected.
what is expected may be a function like:
def get_logps(question, answer):
return logps

or may you explain more about your methods?

@DarkLight1337
Copy link
Member

You can also pass logprobs argument. See this page.

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