Skip to content

Commit

Permalink
revert oai max tokens prop (#1093)
Browse files Browse the repository at this point in the history
* revert oai max tokens prop
* fix startswith
  • Loading branch information
sceuick authored Dec 14, 2024
1 parent 62ad0b4 commit b89330c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion srv/adapter/openai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ export const handleOAI: ModelAdapter = async function* (opts) {
stream: (gen.streamResponse && kind !== 'summary') ?? defaultPresets.openai.streamResponse,
temperature: gen.temp ?? defaultPresets.openai.temp,
max_tokens: maxResponseLength,
max_completion_tokens: maxResponseLength,
top_p: gen.topP ?? 1,
stop: [`\n${handle}:`].concat(gen.stopSequences!),
}
Expand Down
2 changes: 1 addition & 1 deletion srv/adapter/template-chat-payload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export async function toChatMessages(
for (let i = 0; i < history.length; i++) {
const line = history[i]
const original = opts.lines[i]
const role = original.startsWith(sender) ? 'user' : 'assistant'
const role = original?.startsWith(sender) ? 'user' : 'assistant'
messages.push({ role, content: line })
}

Expand Down

0 comments on commit b89330c

Please sign in to comment.