From: Vali Malinoiu Date: Tue, 23 Jul 2024 14:37:42 +0000 (+0300) Subject: server : fix URL.parse in the UI (#8646) X-Git-Tag: upstream/0.0.4488~1039 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=b841d0740855c5af1344a81f261139a45a2b39ee;p=pkg%2Fggml%2Fsources%2Fllama.cpp server : fix URL.parse in the UI (#8646) --- diff --git a/examples/server/public/index-new.html b/examples/server/public/index-new.html index bf2b0a3f..c87dd8f1 100644 --- a/examples/server/public/index-new.html +++ b/examples/server/public/index-new.html @@ -225,7 +225,7 @@ throw new Error("already running"); } controller.value = new AbortController(); - for await (const chunk of llama(prompt, llamaParams, { controller: controller.value, api_url: URL.parse('.', document.baseURI).href })) { + for await (const chunk of llama(prompt, llamaParams, { controller: controller.value, api_url: new URL('.', document.baseURI).href })) { const data = chunk.data; if (data.stop) { while ( diff --git a/examples/server/public/index.html b/examples/server/public/index.html index a1542461..48628a96 100644 --- a/examples/server/public/index.html +++ b/examples/server/public/index.html @@ -479,7 +479,7 @@ throw new Error("already running"); } controller.value = new AbortController(); - for await (const chunk of llama(prompt, llamaParams, { controller: controller.value, api_url: URL.parse('.', document.baseURI).href })) { + for await (const chunk of llama(prompt, llamaParams, { controller: controller.value, api_url: new URL('.', document.baseURI).href })) { const data = chunk.data; if (data.stop) {