From d63c3be556659775721f9ef5ce55f80b5ff91030 Mon Sep 17 00:00:00 2001 From: hoshi-hiyouga Date: Mon, 15 Jul 2024 23:04:39 +0800 Subject: [PATCH] Update test_template.py Former-commit-id: 10289eab158c2de13bdde2d5a7c644195e516201 --- tests/data/test_template.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/data/test_template.py b/tests/data/test_template.py index 56c57074..c1bc1b4b 100644 --- a/tests/data/test_template.py +++ b/tests/data/test_template.py @@ -26,7 +26,6 @@ if TYPE_CHECKING: HF_TOKEN = os.environ.get("HF_TOKEN", None) -raise ValueError("test: " + str(HF_TOKEN)) TINY_LLAMA = os.environ.get("TINY_LLAMA", "llamafactory/tiny-random-Llama-3") @@ -122,7 +121,7 @@ def test_jinja_template(use_fast: bool): assert tokenizer.apply_chat_template(MESSAGES) == ref_tokenizer.apply_chat_template(MESSAGES) -@pytest.mark.skipif(HF_TOKEN is None, reason="Gated model.") +@pytest.mark.skipif(not HF_TOKEN, reason="Gated model.") def test_gemma_template(): prompt_str = ( "user\nHow are you\n" @@ -134,7 +133,7 @@ def test_gemma_template(): _check_template("google/gemma-2-9b-it", "gemma", prompt_str, answer_str, extra_str="\n") -@pytest.mark.skipif(HF_TOKEN is None, reason="Gated model.") +@pytest.mark.skipif(not HF_TOKEN, reason="Gated model.") def test_llama3_template(): prompt_str = ( "<|begin_of_text|><|start_header_id|>user<|end_header_id|>\n\nHow are you<|eot_id|>"