Skip to content

Commit

Permalink
Merge branch 'main' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielmbmb committed Jul 23, 2024
2 parents a3f6cdd + add2b6e commit e99ecdf
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions tests/unit/llms/huggingface/test_inference_endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,11 @@ def test_load_no_api_key(self, mock_inference_client: MagicMock) -> None:
del os.environ["HF_TOKEN"]

llm = InferenceEndpointsLLM(
model_id="distilabel-internal-testing/tiny-random-mistral"
model_id="distilabel-internal-testing/tiny-random-mistral",
structured_output={"format": "regex", "schema": r"\b[A-Z][a-z]*\b"},
)

# Mock `huggingface_hub.constants.HF_TOKEN_PATH` to not exist
with mock.patch("pathlib.Path.exists") as mock_exists:
mock_exists.return_value = False
with pytest.raises(
ValueError,
match="To use `InferenceEndpointsLLM` an API key must be provided",
):
llm.load()
assert llm.tokenizer_id == llm.model_id

def test_load_with_cached_token(self, mock_inference_client: MagicMock) -> None:
llm = InferenceEndpointsLLM(base_url="http://localhost:8000")
Expand Down

0 comments on commit e99ecdf

Please sign in to comment.