Closed BUAADreamer closed 3 months ago
Hey @BUAADreamer - you can follow the guide here on how to use logprobs: https://cookbook.openai.com/examples/using_logprobs#1-using-logprobs-to-assess-confidence-for-classification-tasks
The example presented in this article is quite similar to your use case.
I see, but what I want is the prob of tokens appeared in this history but not new generated tokens
Hmm are you saying that you want probabilities for tokens that you passed to the model as input? That is not supported - the model can only give you probabilities for its own predictions.
Thanks! However, I found REPLUG, a great RAG work, use similar methods to obtain token probs, you can find here: https://github.com/swj0419/REPLUG/blob/6cbe7971a9b761c63aa65f7fe70db3ee82158612/LSR_finetune/replug_lsr.py#L185 But this is used for get GPT-3 or CodeX output, so this way is now invalid for latest GPT3.5/GPT4? If yes, will you reopen this usage in the future?
Ah interesting. Yes you would not be able to plug some of the newer models (4o, 4-turbo, 3.5-turbo) into this library because the legacy completions API used here is not compatible with those models. We do not plan to add support for these models to the legacy completions API.
I can see how the feature implemented in this library could be useful, but it's a bit out of our wheelhouse of the maintainers of this GitHub repo, which is just a Python wrapper around the OpenAI API. We can answer questions about and resolve problems with the Python SDK, but I'm afraid I can't comment particularly intelligently on functionality that was implemented as part of a third party library.
Thanks for such a complete and quick answer!
Confirm this is a feature request for the Python library and not the underlying OpenAI API.
Describe the feature or improvement you're requesting
For a complete context:
Q:Where is Beijing? A:china
I want to get the log_probs ofchina
, how can I do this?Additional context
No response