From 09bbbb75f96921b67ce1ae38b39de14b11492904 Mon Sep 17 00:00:00 2001 From: zhzluke96 Date: Wed, 29 May 2024 20:23:19 +0800 Subject: [PATCH] :bug: command r plus error --- src/components/TokenizerPanel/TokenizerPanel.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/components/TokenizerPanel/TokenizerPanel.tsx b/src/components/TokenizerPanel/TokenizerPanel.tsx index e8e3a3d..bfeb0cf 100644 --- a/src/components/TokenizerPanel/TokenizerPanel.tsx +++ b/src/components/TokenizerPanel/TokenizerPanel.tsx @@ -281,6 +281,13 @@ const TokenizerInfo = ({ {Object.entries(info).map(([key, value]) => { if (key === "chat_template") { + let chat_template_content = value; + if (typeof value === "object") { + chat_template_content = value.default ?? Object.values(value)[0]; + } + if (typeof chat_template_content !== "string") { + chat_template_content = ""; + } return ( {key} @@ -288,7 +295,7 @@ const TokenizerInfo = ({