From c9880bb4d8056a6992d9673f3e1eb37bae866918 Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Mon, 3 Feb 2025 07:34:42 -0500 Subject: [PATCH] Report error when huggingface-cli is not available Fixes: https://github.com/containers/ramalama/issues/688 Signed-off-by: Daniel J Walsh --- ramalama/huggingface.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ramalama/huggingface.py b/ramalama/huggingface.py index 184a107d..675c76f4 100644 --- a/ramalama/huggingface.py +++ b/ramalama/huggingface.py @@ -45,7 +45,7 @@ def __init__(self, model): def login(self, args): if not self.hf_cli_available: - raise NotImplementedError("huggingface-cli not available, skipping login.") + raise NotImplementedError(missing_huggingface) conman_args = ["huggingface-cli", "login"] if args.token: conman_args.extend(["--token", args.token]) @@ -53,7 +53,7 @@ def login(self, args): def logout(self, args): if not self.hf_cli_available: - raise NotImplementedError("huggingface-cli not available, skipping logout.") + raise NotImplementedError(missing_huggingface) conman_args = ["huggingface-cli", "logout"] if args.token: conman_args.extend(["--token", args.token]) @@ -124,8 +124,7 @@ def url_pull(self, args, model_path, directory_path): def push(self, source, args): if not self.hf_cli_available: - print("huggingface-cli not available, skipping push.") - return + raise NotImplementedError(missing_huggingface) proc = run_cmd( [ "huggingface-cli",