-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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 max tokens and add model options #436
base: main
Are you sure you want to change the base?
Conversation
previously max tokens was implemented limiting model context, rather than the API max return token. As far as I know, this is intended by the author. |
https://platform.openai.com/docs/api-reference/chat/create#chat/create-max_tokens
|
In addition, the parameter functionality implemented in my pull request is consistent with the author's current description of the parameter (only controlling the length of the latest message), so I believe this is the functionality they currently want |
@RedwindA they pass it through a function limitMessageTokens that iterates through the messages starting at the most recent and prunes it so that it shows the max amount of complete messages before its token count would hit the max_tokens value. I agree that their description of the max_tokens parameter is not consistent with what they are actually doing. |
Imo properly implementing this fix means having separate max tokens and max context config options. |
damn, I didn't even notice the function limitMessageTokens, thank you for reminding me. They really did it in a confusing way, they shouldn't use a parameter with the same name as the official API parameter to perform a completely different function
|
I had a pretty lengthy discussion about it in jackschedel/KoalaClient#34 that you might want to read. |
1.max_tokens没有被正确传入,该版本传入了参数,使用了Math.min方法确保max_tokens始终合法
2.添加了一个额外的配置,专用于生成标题,设置了温度为0以得到稳定的标题
3.恢复了被注释掉的模型选项,因为不同模型的能力和速度的确有差异
你可以先在这里测试:https://redwinda.github.io/BetterChatGPT-origin/
English verion:
You can test it here first: https://redwinda.github.io/BetterChatGPT-origin/