diff --git a/ramalama/huggingface.py b/ramalama/huggingface.py index 841d82d4..f7d91525 100644 --- a/ramalama/huggingface.py +++ b/ramalama/huggingface.py @@ -1,7 +1,7 @@ import os import pathlib import urllib.request -from ramalama.common import run_cmd, exec_cmd, download_file, verify_checksum +from ramalama.common import available, run_cmd, exec_cmd, download_file, verify_checksum from ramalama.model import Model missing_huggingface = """ @@ -14,10 +14,9 @@ def is_huggingface_cli_available(): """Check if huggingface-cli is available on the system.""" - try: - run_cmd(["huggingface-cli", "version"]) + if available("huggingface-cli"): return True - except FileNotFoundError: + else: print("huggingface-cli not found. Some features may be limited.\n" + missing_huggingface) return False