Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix model download issue: no error message for failed task. #330

Merged
merged 3 commits into from
Dec 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions nexa/gguf/server/nexa_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -732,6 +736,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_path is correct.", status_code=400)

return {
"status": "success",
"message": "Successfully downloaded model",
Expand Down