From d48f62397470e07d84cc7f190388506f75d78bd3 Mon Sep 17 00:00:00 2001 From: Te993 <3923106166@qq.com> Date: Tue, 31 Dec 2024 17:45:46 +0800 Subject: [PATCH 1/3] fix model pull issue: no error message for failed task --- nexa/gguf/server/nexa_service.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nexa/gguf/server/nexa_service.py b/nexa/gguf/server/nexa_service.py index 3db82c8d..cadcf5ab 100644 --- a/nexa/gguf/server/nexa_service.py +++ b/nexa/gguf/server/nexa_service.py @@ -732,6 +732,9 @@ async def download_model(request: DownloadModelRequest): } else: downloaded_path, model_type = pull_model(request.model_path) + if not downloaded_path or not model_type: + return JSONResponse(content="Failed to download model. Please check whether model name is correct.", status_code=400) + return { "status": "success", "message": "Successfully downloaded model", From 4b3e0f6c18a1e5dd5275f8e838bc77cbcb3bb43e Mon Sep 17 00:00:00 2001 From: Te993 <3923106166@qq.com> Date: Tue, 31 Dec 2024 18:08:13 +0800 Subject: [PATCH 2/3] update error message --- nexa/gguf/server/nexa_service.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nexa/gguf/server/nexa_service.py b/nexa/gguf/server/nexa_service.py index cadcf5ab..46d7c1f7 100644 --- a/nexa/gguf/server/nexa_service.py +++ b/nexa/gguf/server/nexa_service.py @@ -733,7 +733,7 @@ async def download_model(request: DownloadModelRequest): else: downloaded_path, model_type = pull_model(request.model_path) if not downloaded_path or not model_type: - return JSONResponse(content="Failed to download model. Please check whether model name is correct.", status_code=400) + return JSONResponse(content="Failed to download model. Please check whether model_path is correct.", status_code=400) return { "status": "success", From 0ee39d5e2caf20687a4e952adbbcf3fc3eca013e Mon Sep 17 00:00:00 2001 From: Te993 <3923106166@qq.com> Date: Tue, 31 Dec 2024 18:09:57 +0800 Subject: [PATCH 3/3] update --- nexa/gguf/server/nexa_service.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nexa/gguf/server/nexa_service.py b/nexa/gguf/server/nexa_service.py index 46d7c1f7..878c309d 100644 --- a/nexa/gguf/server/nexa_service.py +++ b/nexa/gguf/server/nexa_service.py @@ -722,6 +722,10 @@ async def download_model(request: DownloadModelRequest): elif request.model_path in NEXA_RUN_MODEL_MAP_AUDIO_LM: downloaded_path, model_type = pull_model(NEXA_RUN_MODEL_MAP_AUDIO_LM[request.model_path]) projector_downloaded_path, _ = pull_model(NEXA_RUN_AUDIO_LM_PROJECTOR_MAP[request.model_path]) + + if not downloaded_path or not model_type: + return JSONResponse(content="Failed to download model. Please check whether model_path is correct.", status_code=400) + return { "status": "success", "message": "Successfully downloaded model and projector",