Skip to content

Commit

Permalink
add IN_GITHUB_ACTIONS
Browse files Browse the repository at this point in the history
  • Loading branch information
codemayq committed Jul 15, 2024
1 parent 99ab7a8 commit 32c3afd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/data/test_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@


HF_TOKEN = os.environ.get("HF_TOKEN", None)
IN_GITHUB_ACTIONS = os.getenv("GITHUB_ACTIONS") == "true"

TINY_LLAMA = os.environ.get("TINY_LLAMA", "llamafactory/tiny-random-Llama-3")

Expand Down Expand Up @@ -121,7 +122,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(IN_GITHUB_ACTIONS or HF_TOKEN is None, reason="Gated model.")
def test_gemma_template():
prompt_str = (
"<bos><start_of_turn>user\nHow are you<end_of_turn>\n"
Expand All @@ -133,7 +134,7 @@ def test_gemma_template():
_check_template("google/gemma-2-9b-it", "gemma", prompt_str, answer_str, extra_str="<end_of_turn>\n")


@pytest.mark.skipif(HF_TOKEN is None, reason="Gated model.")
@pytest.mark.skipif(IN_GITHUB_ACTIONS or HF_TOKEN is None, 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|>"
Expand Down

0 comments on commit 32c3afd

Please sign in to comment.