From 79b29f7913ec305840dbce117001289be8ed0415 Mon Sep 17 00:00:00 2001 From: Louis Date: Fri, 29 Nov 2024 16:42:59 +0700 Subject: [PATCH 1/2] chore: display error message from response --- web/containers/ModelSearch/index.tsx | 3 +-- web/utils/huggingface.ts | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/web/containers/ModelSearch/index.tsx b/web/containers/ModelSearch/index.tsx index 9f2910fef..9c3ca1cb0 100644 --- a/web/containers/ModelSearch/index.tsx +++ b/web/containers/ModelSearch/index.tsx @@ -46,8 +46,7 @@ const ModelSearch = ({ onSearchLocal }: Props) => { errMessage = err.message } toaster({ - title: 'Oops, you may be rate limited, give it a bit more time', - description: errMessage, + title: errMessage, type: 'error', }) console.error(err) diff --git a/web/utils/huggingface.ts b/web/utils/huggingface.ts index 1550f183a..9167ea7dc 100644 --- a/web/utils/huggingface.ts +++ b/web/utils/huggingface.ts @@ -34,9 +34,7 @@ export const fetchHuggingFaceRepoData = async ( const data = response as HuggingFaceRepoData if (data.tags.indexOf('gguf') === -1) { - throw new Error( - `${repoId} is not supported. Only GGUF models are supported.` - ) + throw new Error(`Only GGUF models are currently supported.`) } // fetching file sizes From 492ff1a7c98ce3ea4fd6fbc94db469b11c989d51 Mon Sep 17 00:00:00 2001 From: Louis Date: Fri, 29 Nov 2024 16:52:39 +0700 Subject: [PATCH 2/2] test: correct test case --- web/utils/huggingface.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/utils/huggingface.test.ts b/web/utils/huggingface.test.ts index 26975f690..9f616cdbe 100644 --- a/web/utils/huggingface.test.ts +++ b/web/utils/huggingface.test.ts @@ -64,7 +64,7 @@ describe('huggingface utils', () => { }) await expect(fetchHuggingFaceRepoData('user/repo')).rejects.toThrow( - 'user/repo is not supported. Only GGUF models are supported.' + 'Only GGUF models are currently supported.' ) })