Skip to content

Commit

Permalink
HF error resolve (#504)
Browse files Browse the repository at this point in the history
  • Loading branch information
luv-bansal authored Feb 5, 2025
1 parent fc99a27 commit 4231441
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion clarifai/runners/utils/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ def __init__(self, repo_id=None, token=None):
login(token=token)
logger.info("Hugging Face token validated")
else:
self.token = None
logger.info("Continuing without Hugging Face token")

@classmethod
def validate_hftoken(cls, hf_token: str):
try:
if importlib.util.find_spec("huggingface_hub") is None:
raise ImportError(cls.HF_DOWNLOAD_TEXT)
os.environ['HF_TOKEN'] = hf_token
from huggingface_hub import HfApi

api = HfApi()
Expand Down

0 comments on commit 4231441

Please sign in to comment.