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 code to adjust max_tokens according to model selection #263

Merged
merged 1 commit into from
May 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix code to adjust max_tokens according to model selection
  • Loading branch information
p4w4n authored and danny-avila committed May 14, 2023
commit 44c14426fc2c3c61e0d5ff2aa3b9133da8f94a7f
3 changes: 2 additions & 1 deletion api/app/clients/chatgpt-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@ const askClient = async ({
};

const azure = process.env.AZURE_OPENAI_API_KEY ? true : false;

const max_tokens = (model === "gpt-4") ? 7200 : (model === "gpt-4-32k") ? 31000 : 3071;
const clientOptions = {
reverseProxyUrl: process.env.OPENAI_REVERSE_PROXY || null,
azure,
modelOptions: {
model: model,
max_tokens: max_tokens,
temperature,
top_p,
presence_penalty,
Expand Down