unit27research commited on
Commit
e8f656d
·
verified ·
1 Parent(s): 9620ce1

Clarify unavailable model IDs

Browse files
Files changed (1) hide show
  1. static-app.js +1 -1
static-app.js CHANGED
@@ -178,7 +178,7 @@
178
  try {
179
  const encoded = repo.split("/").map(encodeURIComponent).join("/");
180
  const apiResponse = await fetch(`https://huggingface.co/api/models/${encoded}`);
181
- if (apiResponse.status === 404) throw new Error("That public model repository was not found.");
182
  if (!apiResponse.ok) throw new Error("The Hub API could not be reached. Try again shortly.");
183
  const api = await apiResponse.json();
184
  if (api.private || api.gated) throw new Error("That model is private or gated. This version reviews public cards only.");
 
178
  try {
179
  const encoded = repo.split("/").map(encodeURIComponent).join("/");
180
  const apiResponse = await fetch(`https://huggingface.co/api/models/${encoded}`);
181
+ if ([401, 403, 404].includes(apiResponse.status)) throw new Error("That model ID is not available as a public Hub repository. Check the ID or choose a public, ungated model.");
182
  if (!apiResponse.ok) throw new Error("The Hub API could not be reached. Try again shortly.");
183
  const api = await apiResponse.json();
184
  if (api.private || api.gated) throw new Error("That model is private or gated. This version reviews public cards only.");