mirror of
https://github.com/huggingface/text-generation-inference.git
synced 2025-09-11 04:14:52 +00:00
fix: bump client tests for api changes
This commit is contained in:
parent
3f035fd8f2
commit
81786840d7
@ -5,13 +5,13 @@ from huggingface_hub.utils import build_hf_headers
|
|||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def flan_t5_xxl():
|
def llama_7b():
|
||||||
return "google/flan-t5-xxl"
|
return "meta-llama/Llama-2-7b-chat-hf"
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def llama_7b():
|
def llama_70b():
|
||||||
return "meta-llama/Llama-2-7b-chat-hf"
|
return "meta-llama/Llama-3.1-70B-Instruct"
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
@ -21,7 +21,7 @@ def fake_model():
|
|||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def unsupported_model():
|
def unsupported_model():
|
||||||
return "gpt2"
|
return "black-forest-labs/FLUX.1-dev"
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
@ -34,11 +34,6 @@ def bloom_url(base_url, bloom_model):
|
|||||||
return f"{base_url}/{bloom_model}"
|
return f"{base_url}/{bloom_model}"
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
|
||||||
def flan_t5_xxl_url(base_url, flan_t5_xxl):
|
|
||||||
return f"{base_url}/{flan_t5_xxl}"
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def llama_7b_url(base_url, llama_7b):
|
def llama_7b_url(base_url, llama_7b):
|
||||||
return f"{base_url}/{llama_7b}"
|
return f"{base_url}/{llama_7b}"
|
||||||
|
@ -10,8 +10,8 @@ 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(llama_70b, unsupported_model, fake_model):
|
||||||
assert check_model_support(flan_t5_xxl)
|
assert check_model_support(llama_70b)
|
||||||
assert not check_model_support(unsupported_model)
|
assert not check_model_support(unsupported_model)
|
||||||
|
|
||||||
with pytest.raises(NotFoundError):
|
with pytest.raises(NotFoundError):
|
||||||
@ -22,8 +22,8 @@ def test_deployed_models():
|
|||||||
deployed_models()
|
deployed_models()
|
||||||
|
|
||||||
|
|
||||||
def test_client(flan_t5_xxl):
|
def test_client(llama_70b):
|
||||||
client = InferenceAPIClient(flan_t5_xxl)
|
client = InferenceAPIClient(llama_70b)
|
||||||
assert isinstance(client, Client)
|
assert isinstance(client, Client)
|
||||||
|
|
||||||
|
|
||||||
@ -32,8 +32,8 @@ def test_client_unsupported_model(unsupported_model):
|
|||||||
InferenceAPIClient(unsupported_model)
|
InferenceAPIClient(unsupported_model)
|
||||||
|
|
||||||
|
|
||||||
def test_async_client(flan_t5_xxl):
|
def test_async_client(llama_70b):
|
||||||
client = InferenceAPIAsyncClient(flan_t5_xxl)
|
client = InferenceAPIAsyncClient(llama_70b)
|
||||||
assert isinstance(client, AsyncClient)
|
assert isinstance(client, AsyncClient)
|
||||||
|
|
||||||
|
|
||||||
|
@ -464,4 +464,4 @@ class DeployedModel(BaseModel):
|
|||||||
# https://github.com/pydantic/pydantic/issues/9177
|
# https://github.com/pydantic/pydantic/issues/9177
|
||||||
model_config = ConfigDict(protected_namespaces=())
|
model_config = ConfigDict(protected_namespaces=())
|
||||||
model_id: str
|
model_id: str
|
||||||
sha: str
|
task: str
|
||||||
|
Loading…
Reference in New Issue
Block a user