Skip to content

Commit

Permalink
Merge pull request #468 from debarshiray/wip/rishi/huggingface-compat…
Browse files Browse the repository at this point in the history
…ible-with-huggingface-cli-older-than-0.25.0

Support huggingface-cli older than 0.25.0, like on Fedora 40 and 41
  • Loading branch information
rhatdan authored Nov 19, 2024
2 parents 930a64f + 19f1918 commit f498bd6
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
@@ -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 = """
Expand All @@ -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

Expand Down

0 comments on commit f498bd6

Please sign in to comment.