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

docs: explanation about LogitBias. (#129) #426

Merged

Conversation

vvatanabe
Copy link
Collaborator

@vvatanabe vvatanabe commented Jul 7, 2023

Describe the change
I've added comments to clarify the values of LogitBias, as they were difficult to understand.

Tests
None

Additional context
Issue: #129

@sashabaranov

@vvatanabe vvatanabe changed the title docs: explanation about LogitBias. (129) docs: explanation about LogitBias. (#129) Jul 7, 2023
// LogitBias is must be a token id string (specified by their token ID in the tokenizer), not a word string.
// incorrect: `"logit_bias":{"You": 6}`, correct: `"logit_bias":{"1639": 6}`
// refs: https://platform.openai.com/docs/api-reference/completions/create#completions/create-logit_bias
LogitBias map[string]int `json:"logit_bias,omitempty"`
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much! This wins the "most non-trivial API of the year" on the OpenAI side! :D

@sashabaranov sashabaranov merged commit 181fc2a into sashabaranov:master Jul 9, 2023
1 check passed
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

Successfully merging this pull request may close these issues.

None yet

2 participants