From 59b3bd501998c593c45a449a3fe0f2162221c112 Mon Sep 17 00:00:00 2001 From: mic Date: Tue, 1 Oct 2024 21:51:55 +0200 Subject: [PATCH] printing lines to the log --- api_webchat/model-worker-openai.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/api_webchat/model-worker-openai.js b/api_webchat/model-worker-openai.js index de9ba27c..6561613b 100644 --- a/api_webchat/model-worker-openai.js +++ b/api_webchat/model-worker-openai.js @@ -129,7 +129,11 @@ self.onmessage = async function(event) { const parsedLines = lines .map((line) => line.replace(/^data: /, "").trim()) // Remove the "data: " prefix .filter((line) => line !== "" && line !== "[DONE]") // Remove empty lines and "[DONE]" - .map((line) => JSON.parse(line)); // Parse the JSON string + // .map((line) => JSON.parse(line)); // Parse the JSON string + .map((line) => { + console.log(">>>>>>>>>>>>> [ThunderAI] line: " + JSON.stringify(line)); + return JSON.parse(line); + }); for (const parsedLine of parsedLines) { const { choices } = parsedLine;