fix llama-server ui: Replace URL.parse Method in llama-server ui

This commit is contained in:
Vali Malinoiu 2024-07-23 15:24:49 +03:00
parent 938943cdbf
commit 076548d0a3
2 changed files with 2 additions and 2 deletions

View file

@ -225,7 +225,7 @@
throw new Error("already running"); throw new Error("already running");
} }
controller.value = new AbortController(); 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; const data = chunk.data;
if (data.stop) { if (data.stop) {
while ( while (

View file

@ -479,7 +479,7 @@
throw new Error("already running"); throw new Error("already running");
} }
controller.value = new AbortController(); 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; const data = chunk.data;
if (data.stop) { if (data.stop) {