Skip to content

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
nsarrazin committed Dec 9, 2024
1 parent 2eabd3b commit 287c512
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/lib/server/endpoints/openai/endpointOai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ export async function endpointOai(
}

// if system role is not supported, convert first message to a user message.
if(!model.systemRoleSupported && messagesOpenAI?.[0]?.role === "system") {
if (!model.systemRoleSupported && messagesOpenAI?.[0]?.role === "system") {
messagesOpenAI[0].role = "user";
}

Expand Down Expand Up @@ -249,7 +249,9 @@ export async function endpointOai(
model: model.id ?? model.name,
messages: messagesOpenAI,
stream: true,
...(useCompletionTokens) ? {max_completion_tokens: parameters?.max_new_tokens} : {max_tokens: parameters?.max_new_tokens},
...(useCompletionTokens
? { max_completion_tokens: parameters?.max_new_tokens }
: { max_tokens: parameters?.max_new_tokens }),
stop: parameters?.stop,
temperature: parameters?.temperature,
top_p: parameters?.top_p,
Expand Down

0 comments on commit 287c512

Please sign in to comment.