RayMelius Claude Sonnet 4.6 commited on
Commit
a32c399
·
1 Parent(s): c04bdc8

Fix misleading error message: model not available vs providers not enabled

Browse files
Files changed (1) hide show
  1. dashboard/dashboard.py +4 -5
dashboard/dashboard.py CHANGED
@@ -124,8 +124,8 @@ def _call_llm(prompt):
124
  except Exception:
125
  err_code = ""
126
  if err_code == "model_not_supported" or "provider" in r.text.lower():
127
- return None, ("HF providers not enabled. Go to huggingface.co/settings/inference-providers "
128
- "and enable at least one provider (e.g. Cerebras, Groq, or HF Inference).")
129
  return None, f"HF HTTP {r.status_code}: {r.text[:120]}"
130
  except requests.exceptions.Timeout:
131
  print(f"[Dashboard/LLM] HF timeout (attempt {attempt+1})")
@@ -618,9 +618,8 @@ def ai_debug():
618
  result["response_json"] = rj
619
  err_code = rj.get("error", {}).get("code", "")
620
  if err_code == "model_not_supported" or "provider" in r.text.lower():
621
- result["fix"] = ("Enable inference providers at: "
622
- "https://huggingface.co/settings/inference-providers "
623
- "Enable at least one free provider: Cerebras, Groq, SambaNova, or HF Inference.")
624
  except Exception:
625
  pass
626
  except Exception as e:
 
124
  except Exception:
125
  err_code = ""
126
  if err_code == "model_not_supported" or "provider" in r.text.lower():
127
+ return None, (f"Model '{HF_MODEL}' not available on any enabled provider. "
128
+ "Set HF_MODEL secret to a supported model (e.g. Qwen/Qwen2.5-7B-Instruct).")
129
  return None, f"HF HTTP {r.status_code}: {r.text[:120]}"
130
  except requests.exceptions.Timeout:
131
  print(f"[Dashboard/LLM] HF timeout (attempt {attempt+1})")
 
618
  result["response_json"] = rj
619
  err_code = rj.get("error", {}).get("code", "")
620
  if err_code == "model_not_supported" or "provider" in r.text.lower():
621
+ result["fix"] = (f"Model '{HF_MODEL}' not available on any enabled provider. "
622
+ "Try a different model or check huggingface.co/settings/inference-providers.")
 
623
  except Exception:
624
  pass
625
  except Exception as e: