Skip to content

Commit

Permalink
[Test] Skip tokenizer tests if transformers is not in workspace
Browse files Browse the repository at this point in the history
ghstack-source-id: b92facfd14cba62511e7888567c94d3986419ab5
Pull Request resolved: #2744
  • Loading branch information
vmoens committed Feb 3, 2025
1 parent 10f015e commit 20a19fe
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/test_transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@
TIMEOUT = 100.0

_has_gymnasium = importlib.util.find_spec("gymnasium") is not None
_has_transformers = importlib.util.find_spec("transformers") is not None


class TransformBase:
Expand Down Expand Up @@ -2532,6 +2533,9 @@ def test_transform_inverse(self):
)


@pytest.mark.skipif(
not _has_transformers, reason="transformers needed to test tokenizers"
)
class TestTokenizer(TransformBase):
@pytest.mark.parametrize("datatype", ["str", "NonTensorStack"])
def test_transform_no_env(self, datatype):
Expand Down

1 comment on commit 20a19fe

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'CPU Benchmark Results'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: 20a19fe Previous: ffa99b2 Ratio
benchmarks/test_replaybuffer_benchmark.py::test_rb_populate[TensorDictReplayBuffer-ListStorage-SamplerWithoutReplacement-400] 35.6439714628085 iter/sec (stddev: 0.16909637176210868) 237.07252078846943 iter/sec (stddev: 0.0005743337387450013) 6.65

This comment was automatically generated by workflow using github-action-benchmark.

CC: @vmoens

Please sign in to comment.