Commit e71ef421 authored by Timothy J. Baek's avatar Timothy J. Baek
Browse files

fix: stop seq backslash issue

parent 7f3daa19
......@@ -347,9 +347,6 @@
)
.flat(1);
console.log($settings.options.stop);
// console.log($settings.options.stop.map((str) => str));
const [res, controller] = await generateChatCompletion(localStorage.token, {
model: model,
messages: messagesBody,
......
......@@ -365,7 +365,13 @@
model: model,
messages: messagesBody,
options: {
...($settings.options ?? {})
...($settings.options ?? {}),
stop:
$settings?.options?.stop ?? undefined
? $settings.options.stop.map((str) =>
decodeURIComponent(JSON.parse('"' + str.replace(/\"/g, '\\"') + '"'))
)
: undefined
},
format: $settings.requestFormat ?? undefined,
keep_alive: $settings.keepAlive ?? undefined,
......@@ -588,7 +594,12 @@
})
})),
seed: $settings?.options?.seed ?? undefined,
stop: $settings?.options?.stop ?? undefined,
stop:
$settings?.options?.stop ?? undefined
? $settings.options.stop.map((str) =>
decodeURIComponent(JSON.parse('"' + str.replace(/\"/g, '\\"') + '"'))
)
: undefined,
temperature: $settings?.options?.temperature ?? undefined,
top_p: $settings?.options?.top_p ?? undefined,
num_ctx: $settings?.options?.num_ctx ?? undefined,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment