feat(model): return logprobs for prompt (also for max_tokens=0) by nicpopovic · Pull Request #84 · hyperonym/basaran · GitHub
Skip to content
This repository was archived by the owner on Jan 24, 2024. It is now read-only.

feat(model): return logprobs for prompt (also for max_tokens=0) - #84

Open
nicpopovic wants to merge 3 commits into
hyperonym:masterfrom
nicpopovic:dev-logprobs
Open

nicpopovic wants to merge 3 commits into
hyperonym:masterfrom
nicpopovic:dev-logprobs

Conversation

@nicpopovic

Copy link
Copy Markdown

Hi,

Cool project!

OpenAIs API allows you get logprobs for a prompt without generating text (max_tokens=0, logprobs=1).
So far your API returns zero as logprobs for input tokens.

This PR is a quick implementation of this feature (not particularly elegant, but maybe you'll find it useful).

Cheers,
Nicholas

@peakji

peakji commented Mar 23, 2023

Copy link
Copy Markdown
Member

@nicpopovic

Copy link
Copy Markdown
Author

Woops, looks like I didn't test with encoder_decoder models, sorry about that...

Tests are passing for me now.

@peakji
peakji requested a review from fardeon March 23, 2023 15:46
@peakji

peakji commented Mar 28, 2023

Copy link
Copy Markdown
Member

@peakji peakji added the enhancement New feature or request label Mar 28, 2023
@peakji peakji changed the title feat(model): Return logprobs for prompt (also for max_tokens=0) feat(model): return logprobs for prompt (also for max_tokens=0) Apr 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants