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

Remove max_tokens from openai_chat.py #563

Merged
merged 1 commit into from
Jul 25, 2024
Merged

Remove max_tokens from openai_chat.py #563

merged 1 commit into from
Jul 25, 2024

Conversation

boeckers
Copy link
Contributor

@boeckers boeckers commented Jul 22, 2024

In vanna, max_tokens is used to control the size of the prompt that is generated from the user question. This should be sufficiently large (defaults to 14k)
In openai, max_tokens defines the maximum length of the generated output (max. ca. 5k). This should be controlled by a different parameter (if at all)

@boeckers
Copy link
Contributor Author

@zainhoda Can you please review?

@zainhoda
Copy link
Contributor

Ah yeah I see the issue. max_tokens is being used for both input and output tokens. While I like the idea, I think this might be a breaking change for some people so we need to collect some more feedback.

@andreped do you have any thoughts on this?

I'll go ask around in the meantime

@andreped
Copy link
Contributor

@andreped do you have any thoughts on this?

Sorry for the late reply. We currently override the relevant methods in our current solution, so we won't be affected by this.

This should be controlled by a different parameter (if at all)

I think the last detail is quite important. I am not so sure we should set max_tokens at all. If I recall correctly, this was necessary way back, as the max_tokens used was hardcoded to 500 throughout this class, hence there was added a feature to alter it.

Perhaps the default should be None in the constructor and then people can override this parameter if they would like? Thoughts, @zainhoda, @boeckers?

@zainhoda zainhoda merged commit de94875 into vanna-ai:main Jul 25, 2024
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.

3 participants