forked from phoenix-oss/llama-stack-mirror
better test naming
This commit is contained in:
parent
ab54b8cd58
commit
182608d4bf
1 changed files with 41 additions and 20 deletions
|
@ -139,28 +139,49 @@ def client_with_models(llama_stack_client, text_model_id, vision_model_id, embed
|
||||||
return client
|
return client
|
||||||
|
|
||||||
|
|
||||||
|
MODEL_SHORT_IDS = {
|
||||||
|
"meta-llama/Llama-3.1-8B-Instruct": "8B",
|
||||||
|
"meta-llama/Llama-3.2-11B-Vision-Instruct": "11B",
|
||||||
|
"all-MiniLM-L6-v2": "MiniLM",
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def get_short_id(value):
|
||||||
|
return MODEL_SHORT_IDS.get(value, value)
|
||||||
|
|
||||||
|
|
||||||
def pytest_generate_tests(metafunc):
|
def pytest_generate_tests(metafunc):
|
||||||
|
params = []
|
||||||
|
values = []
|
||||||
|
id_parts = []
|
||||||
|
|
||||||
if "text_model_id" in metafunc.fixturenames:
|
if "text_model_id" in metafunc.fixturenames:
|
||||||
metafunc.parametrize(
|
params.append("text_model_id")
|
||||||
"text_model_id",
|
val = metafunc.config.getoption("--inference-model")
|
||||||
[metafunc.config.getoption("--inference-model")],
|
values.append(val)
|
||||||
scope="session",
|
id_parts.append(f"txt={get_short_id(val)}")
|
||||||
)
|
|
||||||
if "vision_model_id" in metafunc.fixturenames:
|
if "vision_model_id" in metafunc.fixturenames:
|
||||||
metafunc.parametrize(
|
params.append("vision_model_id")
|
||||||
"vision_model_id",
|
val = metafunc.config.getoption("--vision-inference-model")
|
||||||
[metafunc.config.getoption("--vision-inference-model")],
|
values.append(val)
|
||||||
scope="session",
|
id_parts.append(f"vis={get_short_id(val)}")
|
||||||
)
|
|
||||||
if "embedding_model_id" in metafunc.fixturenames:
|
if "embedding_model_id" in metafunc.fixturenames:
|
||||||
metafunc.parametrize(
|
params.append("embedding_model_id")
|
||||||
"embedding_model_id",
|
val = metafunc.config.getoption("--embedding-model")
|
||||||
[metafunc.config.getoption("--embedding-model")],
|
values.append(val)
|
||||||
scope="session",
|
if val is not None:
|
||||||
)
|
id_parts.append(f"emb={get_short_id(val)}")
|
||||||
|
|
||||||
if "embedding_dimension" in metafunc.fixturenames:
|
if "embedding_dimension" in metafunc.fixturenames:
|
||||||
metafunc.parametrize(
|
params.append("embedding_dimension")
|
||||||
"embedding_dimension",
|
val = metafunc.config.getoption("--embedding-dimension")
|
||||||
[metafunc.config.getoption("--embedding-dimension")],
|
values.append(val)
|
||||||
scope="session",
|
if val != 384:
|
||||||
)
|
id_parts.append(f"dim={val}")
|
||||||
|
|
||||||
|
if params:
|
||||||
|
# Create a single test ID string
|
||||||
|
test_id = ":".join(id_parts)
|
||||||
|
metafunc.parametrize(params, [values], scope="session", ids=[test_id])
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue