From 3e27e9711021fa7a996040c9e88266f9fb054cea Mon Sep 17 00:00:00 2001 From: NamH Date: Fri, 15 Mar 2024 10:33:59 +0700 Subject: [PATCH] fix: use model from model hub not load correct model in thread screen (#2368) Signed-off-by: James Co-authored-by: James --- web/hooks/useCreateNewThread.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/web/hooks/useCreateNewThread.ts b/web/hooks/useCreateNewThread.ts index 247c65c55..55faded37 100644 --- a/web/hooks/useCreateNewThread.ts +++ b/web/hooks/useCreateNewThread.ts @@ -74,11 +74,15 @@ export const useCreateNewThread = () => { const defaultModel = model ?? recommendedModel ?? downloadedModels[0] - // check last thread message, if there empty last message use can not create thread - const lastMessage = threads[0]?.metadata?.lastMessage + if (!model) { + // if we have model, which means user wants to create new thread from Model hub. Allow them. - if (!lastMessage && threads.length) { - return null + // check last thread message, if there empty last message use can not create thread + const lastMessage = threads[0]?.metadata?.lastMessage + + if (!lastMessage && threads.length) { + return null + } } // modify assistant tools when experimental on, retieval toggle enabled in default