mirror of
https://github.com/huggingface/text-generation-inference.git
synced 2025-04-27 21:12:07 +00:00
test(neuron): add helper to batch export models
Also rename fixture file fro clarity.
This commit is contained in:
parent
70e846d53b
commit
53c1226939
@ -1,4 +1,4 @@
|
|||||||
pytest_plugins = ["fixtures.neuron.service", "fixtures.neuron.model"]
|
pytest_plugins = ["fixtures.neuron.service", "fixtures.neuron.export_models"]
|
||||||
# ruff: noqa: E402
|
# ruff: noqa: E402
|
||||||
from _pytest.fixtures import SubRequest
|
from _pytest.fixtures import SubRequest
|
||||||
import requests
|
import requests
|
||||||
|
@ -216,6 +216,11 @@ def maybe_export_model(config_name, model_config):
|
|||||||
return neuron_model_id
|
return neuron_model_id
|
||||||
|
|
||||||
|
|
||||||
|
def maybe_export_models():
|
||||||
|
for config_name, model_config in MODEL_CONFIGURATIONS.items():
|
||||||
|
maybe_export_model(config_name, model_config)
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="session", params=MODEL_CONFIGURATIONS.keys())
|
@pytest.fixture(scope="session", params=MODEL_CONFIGURATIONS.keys())
|
||||||
def neuron_model_config(request):
|
def neuron_model_config(request):
|
||||||
"""Expose a pre-trained neuron model
|
"""Expose a pre-trained neuron model
|
||||||
@ -262,3 +267,7 @@ def neuron_model_config(request):
|
|||||||
@pytest.fixture(scope="module")
|
@pytest.fixture(scope="module")
|
||||||
def neuron_model_path(neuron_model_config):
|
def neuron_model_path(neuron_model_config):
|
||||||
yield neuron_model_config["neuron_model_path"]
|
yield neuron_model_config["neuron_model_path"]
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
maybe_export_models()
|
Loading…
Reference in New Issue
Block a user