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

fix bug in getNumTokensFromMessages #1149

Merged
merged 1 commit into from
May 11, 2023

Conversation

pczekaj
Copy link
Contributor

@pczekaj pczekaj commented May 7, 2023

getNumTokensFromMessages wasn't doing the same thing as described in: https://github.com/openai/openai-cookbook/blob/main/examples/How_to_format_inputs_to_ChatGPT_models.ipynb

because it didn't include in calculation message role, name content and didn't add 3 to total count

getNumTokensFromMessages wasn't doing the same thing as described in:
https://github.com/openai/openai-cookbook/blob/main/examples/How_to_format_inputs_to_ChatGPT_models.ipynb

because it didn't include in calculation message role, name content and didn't add 3 to total count
@vercel
Copy link

vercel bot commented May 7, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
langchainjs-docs ✅ Ready (Inspect) Visit Preview May 7, 2023 5:50am

@jacoblee93 jacoblee93 added the lgtm PRs that are ready to be merged as-is label May 11, 2023
@jacoblee93
Copy link
Collaborator

Thanks for the catch!

@nfcampos nfcampos merged commit 5ee801f into langchain-ai:main May 11, 2023
@pczekaj pczekaj deleted the num-tokens-fix branch May 12, 2023 05:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm PRs that are ready to be merged as-is
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants