[Bugfix] Add GatedRepoError Report (#1616)
Signed-off-by: Zhanqiu Hu <zhu@redhat.com>
This commit is contained in:
1 parent
bb239fa949
commit
1a93818e54
1 file changed
+7
-1
@@ -70,8 +70,14 @@ def omni_snapshot_download(model_id: str) -> str:
|
||||
allow_patterns=["*"],
|
||||
require_all=True,
|
||||
)
|
||||
except huggingface_hub.errors.GatedRepoError:
|
||||
raise ValueError(
|
||||
f"Access to model '{model_id}' is restricted. "
|
||||
f"Visit https://huggingface.co/{model_id} to accept "
|
||||
f"the license and request access."
|
||||
)
|
||||
except huggingface_hub.errors.RepositoryNotFoundError:
|
||||
logger.warning("Repository not found for '%s'.", model_id)
|
||||
raise ValueError(f"Repository not found for '{model_id}'. Please check the model name or path.")
|
||||
except PermissionError:
|
||||
logger.warning(
|
||||
"Permission denied when downloading '%s'. Assuming the model is already cached locally.",
|
||||
|
||||
Reference in new issue
Block a user