mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-10-17 15:13:49 +00:00
yet another refactor to make this more general
now it accepts --inference-model, --safety-model options also
This commit is contained in:
parent
2ed0267fbb
commit
60800bc09b
13 changed files with 127 additions and 61 deletions
|
@ -57,7 +57,34 @@ def pytest_configure(config):
|
|||
)
|
||||
|
||||
|
||||
def pytest_addoption(parser):
|
||||
parser.addoption(
|
||||
"--inference-model",
|
||||
action="store",
|
||||
default="Llama3.1-8B-Instruct",
|
||||
help="Specify the inference model to use for testing",
|
||||
)
|
||||
parser.addoption(
|
||||
"--safety-model",
|
||||
action="store",
|
||||
default="Llama-Guard-3-8B",
|
||||
help="Specify the safety model to use for testing",
|
||||
)
|
||||
|
||||
|
||||
def pytest_generate_tests(metafunc):
|
||||
if "inference_model" in metafunc.fixturenames:
|
||||
metafunc.parametrize(
|
||||
"inference_model",
|
||||
[pytest.param(metafunc.config.getoption("--inference-model"), id="")],
|
||||
indirect=True,
|
||||
)
|
||||
if "safety_model" in metafunc.fixturenames:
|
||||
metafunc.parametrize(
|
||||
"safety_model",
|
||||
[pytest.param(metafunc.config.getoption("--safety-model"), id="")],
|
||||
indirect=True,
|
||||
)
|
||||
if "agents_stack" in metafunc.fixturenames:
|
||||
available_fixtures = {
|
||||
"inference": INFERENCE_FIXTURES,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue