diff --git a/tests/unit/llms/huggingface/test_inference_endpoints.py b/tests/unit/llms/huggingface/test_inference_endpoints.py index cd45c91153..b4d32b26ae 100644 --- a/tests/unit/llms/huggingface/test_inference_endpoints.py +++ b/tests/unit/llms/huggingface/test_inference_endpoints.py @@ -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")