Friendlier unsupported model errors, show estimated download size
1. Backend: When a model fails with "No config file found" or similar unsupported-model errors, wrap the message with "This model is not supported yet. Try a different model." instead of showing the raw Unsloth exception. 2. Frontend: Compute estimated download size from the HF search API's safetensors.parameters dtype breakdown (BF16=2B/param, I32=4B/param, F32=4B/param, etc.) and show it in the model picker instead of just the param count. For example, Kimi-K2.5 now shows "~554 GB" instead of "171B" (which was misleading since 171B params != 171GB download).
This commit is contained in:
parent
1471c63b96
commit
f20c7ca54d
3 changed files with 41 additions and 4 deletions
|
|
@ -288,7 +288,17 @@ async def load_model(
|
|||
raise
|
||||
except Exception as e:
|
||||
logger.error(f"Error loading model: {e}", exc_info = True)
|
||||
raise HTTPException(status_code = 500, detail = f"Failed to load model: {str(e)}")
|
||||
msg = str(e)
|
||||
# Surface a friendlier message for models that Unsloth cannot load
|
||||
not_supported_hints = [
|
||||
"No config file found",
|
||||
"not yet supported",
|
||||
"is not supported",
|
||||
"does not support",
|
||||
]
|
||||
if any(h.lower() in msg.lower() for h in not_supported_hints):
|
||||
msg = f"This model is not supported yet. Try a different model. (Original error: {msg})"
|
||||
raise HTTPException(status_code = 500, detail = f"Failed to load model: {msg}")
|
||||
|
||||
|
||||
@router.post("/validate", response_model = ValidateModelResponse)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue