Skip to content

Commit

Permalink
Report error when huggingface-cli is not available
Browse files Browse the repository at this point in the history
Fixes: #688

Signed-off-by: Daniel J Walsh <[email protected]>
  • Loading branch information
rhatdan committed Feb 3, 2025
1 parent 82d34c0 commit c9880bb
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions ramalama/huggingface.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ 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])
self.exec(conman_args, 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])
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit c9880bb

Please sign in to comment.