From fc4235943d2dd36a13aaf119c2b33826790f2a99 Mon Sep 17 00:00:00 2001 From: Anuraag Jain Date: Sat, 13 Jan 2024 09:49:22 +0200 Subject: [PATCH] fix: sanitized model name --- src/lib/components/chat/SettingsModal.svelte | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/lib/components/chat/SettingsModal.svelte b/src/lib/components/chat/SettingsModal.svelte index 845d3dc6..841cf9a3 100644 --- a/src/lib/components/chat/SettingsModal.svelte +++ b/src/lib/components/chat/SettingsModal.svelte @@ -314,8 +314,9 @@ }; const pullModelHandler = async () => { - if (modelDownloadStatus[modelTag]) { - toast.error(`Model '${modelTag}' is already in queue for downloading.`); + const sanitizedModelTag = modelTag.trim(); + if (modelDownloadStatus[sanitizedModelTag]) { + toast.error(`Model '${sanitizedModelTag}' is already in queue for downloading.`); return; } if (Object.keys(modelDownloadStatus).length === 3) { @@ -326,7 +327,7 @@ modelTransferring = true; modelDownloadQueue.push( - { modelName: modelTag }, + { modelName: sanitizedModelTag }, async (data: { modelName: string; success: boolean; error?: Error }) => { const { modelName } = data; // Remove the downloaded model