Skip to content

Commit ba5bb26

Browse files
skip tracing tests if token unavailable (#1493)
SUMMARY: some tests in `tests/llmcompressor/transformers/tracing/test_models.py` requiring access to gated HF hub models will fail for community user PRs, because `HF_TOKEN` is not injected. This just skips the tests in question. This update allows #1446 and #1445 to pass GHA checks so that they can be merged in TEST PLAN: n/a Signed-off-by: Brian Dellabetta <bdellabe@redhat.com>
1 parent de91684 commit ba5bb26

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/llmcompressor/transformers/tracing/test_models.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import os
2+
13
import pytest
24
from transformers import (
35
AutoModelForCausalLM,
@@ -16,6 +18,10 @@
1618
from llmcompressor.utils.pytorch.module import get_no_split_params
1719

1820

21+
@pytest.mark.skipif(
22+
os.getenv("HF_TOKEN") is None,
23+
reason="Skipping tracing tests requiring gated model access",
24+
)
1925
@pytest.mark.parametrize(
2026
"model_id,model_class,targets,modality,backends",
2127
[

0 commit comments

Comments
 (0)