Skip to content

Commit

Permalink
fix hf-inference _prepare_api_key
Browse files Browse the repository at this point in the history
  • Loading branch information
Wauplin committed Feb 11, 2025
1 parent 9d6f2a3 commit d041ceb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/huggingface_hub/inference/_providers/hf_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def __init__(self, task: str):

def _prepare_api_key(self, api_key: Optional[str]) -> str:
# special case: for HF Inference we allow not providing an API key
return get_token() # type: ignore[return-value]
return api_key or get_token() # type: ignore[return-value]

def _prepare_mapped_model(self, model: Optional[str]) -> str:
if model is not None:
Expand Down

0 comments on commit d041ceb

Please sign in to comment.