diff --git a/src/routes/(app)/+page.svelte b/src/routes/(app)/+page.svelte index bcaad8c5b..f745fcbe6 100644 --- a/src/routes/(app)/+page.svelte +++ b/src/routes/(app)/+page.svelte @@ -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, diff --git a/src/routes/(app)/c/[id]/+page.svelte b/src/routes/(app)/c/[id]/+page.svelte index cbf0595a9..33578681f 100644 --- a/src/routes/(app)/c/[id]/+page.svelte +++ b/src/routes/(app)/c/[id]/+page.svelte @@ -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,