Ignore entirely the API.

This commit is contained in:
Nicolas Patry 2025-02-19 14:52:16 +01:00
parent 41d2c559a4
commit 9c1f2574cb
No known key found for this signature in database
GPG Key ID: 4242CEF24CB6DBF9

View File

@ -1,42 +1,42 @@
import pytest # import pytest
#
from text_generation import ( # from text_generation import (
InferenceAPIClient, # InferenceAPIClient,
InferenceAPIAsyncClient, # InferenceAPIAsyncClient,
Client, # Client,
AsyncClient, # AsyncClient,
) # )
from text_generation.errors import NotSupportedError, NotFoundError # from text_generation.errors import NotSupportedError, NotFoundError
from text_generation.inference_api import check_model_support, deployed_models # from text_generation.inference_api import check_model_support, deployed_models
#
#
def test_check_model_support(flan_t5_xxl, unsupported_model, fake_model): # def test_check_model_support(flan_t5_xxl, unsupported_model, fake_model):
assert check_model_support(flan_t5_xxl) # assert check_model_support(flan_t5_xxl)
assert not check_model_support(unsupported_model) # assert not check_model_support(unsupported_model)
#
with pytest.raises(NotFoundError): # with pytest.raises(NotFoundError):
check_model_support(fake_model) # check_model_support(fake_model)
#
#
def test_deployed_models(): # def test_deployed_models():
deployed_models() # deployed_models()
#
#
def test_client(flan_t5_xxl): # def test_client(flan_t5_xxl):
client = InferenceAPIClient(flan_t5_xxl) # client = InferenceAPIClient(flan_t5_xxl)
assert isinstance(client, Client) # assert isinstance(client, Client)
#
#
def test_client_unsupported_model(unsupported_model): # def test_client_unsupported_model(unsupported_model):
with pytest.raises(NotSupportedError): # with pytest.raises(NotSupportedError):
InferenceAPIClient(unsupported_model) # InferenceAPIClient(unsupported_model)
#
#
def test_async_client(flan_t5_xxl): # def test_async_client(flan_t5_xxl):
client = InferenceAPIAsyncClient(flan_t5_xxl) # client = InferenceAPIAsyncClient(flan_t5_xxl)
assert isinstance(client, AsyncClient) # assert isinstance(client, AsyncClient)
#
#
def test_async_client_unsupported_model(unsupported_model): # def test_async_client_unsupported_model(unsupported_model):
with pytest.raises(NotSupportedError): # with pytest.raises(NotSupportedError):
InferenceAPIAsyncClient(unsupported_model) # InferenceAPIAsyncClient(unsupported_model)