From 7e9bb31f4b03e7c85e12e3641ce05ae3d0574184 Mon Sep 17 00:00:00 2001 From: Stephen Baione Date: Fri, 24 Jan 2025 00:17:50 +0000 Subject: [PATCH] Fix fixture, Update test ids --- app_tests/integration_tests/llm/shortfin/conftest.py | 6 +++--- .../integration_tests/llm/shortfin/cpu_llm_server_test.py | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app_tests/integration_tests/llm/shortfin/conftest.py b/app_tests/integration_tests/llm/shortfin/conftest.py index 64a2e0dd3..ce7647bc6 100644 --- a/app_tests/integration_tests/llm/shortfin/conftest.py +++ b/app_tests/integration_tests/llm/shortfin/conftest.py @@ -93,7 +93,7 @@ def server(model_artifacts, request): process.wait() -@pytest.fixture(scope="function") -def encoded_prompt(model_artifacts: ModelArtifacts, prompt: str) -> list[int]: +@pytest.fixture(scope="module") +def encoded_prompt(model_artifacts: ModelArtifacts, request) -> list[int]: tokenizer = Tokenizer.from_file(model_artifacts.tokenizer_path) - return tokenizer.encode(prompt).ids + return tokenizer.encode(request.param).ids diff --git a/app_tests/integration_tests/llm/shortfin/cpu_llm_server_test.py b/app_tests/integration_tests/llm/shortfin/cpu_llm_server_test.py index a4b089a80..27a9508b1 100644 --- a/app_tests/integration_tests/llm/shortfin/cpu_llm_server_test.py +++ b/app_tests/integration_tests/llm/shortfin/cpu_llm_server_test.py @@ -109,10 +109,10 @@ def test_basic_generation(self, server: tuple[Any, int]) -> None: ), ], ids=[ - "open_llama_3b_none", - "open_llama_3b_trie", - "llama31_8b_none", - "llama31_8b_trie", + "open_llama_3b_none_input_ids", + "open_llama_3b_trie_input_ids", + "llama31_8b_none_input_ids", + "llama31_8b_trie_input_ids", ], indirect=True, )