From 958f4f6044159ce7aa88148b2264f4568653e677 Mon Sep 17 00:00:00 2001 From: GMohammadAli Date: Wed, 16 Jul 2025 00:33:13 +0530 Subject: [PATCH] Bug Fix: When I use a custom name and then change my mind and try to use one of the default ones, it doesn't update in the textarea below --- src/sections/ChatGPTEditor.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/sections/ChatGPTEditor.tsx b/src/sections/ChatGPTEditor.tsx index 18e6d13..85750ba 100644 --- a/src/sections/ChatGPTEditor.tsx +++ b/src/sections/ChatGPTEditor.tsx @@ -64,7 +64,7 @@ function getChatGPTEncoding( return [ messages .map(({ name, role, content }) => { - return `<|im_start|>${name || role}${roleSep}${content}<|im_end|>`; + return `<|im_start|>${role === 'system-name' ? name : role}${roleSep}${content}<|im_end|>`; }) .join(msgSep), `<|im_start|>assistant${roleSep}`, @@ -105,8 +105,7 @@ export function ChatGPTEditor(props: { onValueChange={(val) => setRows((rows) => { const newRows = [...rows]; - // @ts-expect-error - newRows[i].role = val; + (newRows[i] as any).role = val; return newRows; }) }