Skip to content

Commit

Permalink
Merge pull request #719 from rhatdan/huggingface
Browse files Browse the repository at this point in the history
Report error when huggingface-cli is not available
  • Loading branch information
ericcurtin authored Feb 3, 2025
2 parents 82d34c0 + c9880bb commit 9ab4d91
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 9ab4d91

Please sign in to comment.