Skip to content

Commit 2d3ed8d

Browse files
committed
fix flaky test
1 parent 0069195 commit 2d3ed8d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tests/modules/test_hf_model.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ def test_load_gated_model(mocker: MockerFixture):
2323

2424
def test_load_ungated_model(mocker: MockerFixture):
2525
conf = MockConfig(architectures=["ConditionalGeneration"])
26+
# Mock the environment to ensure no default token is used
27+
mocker.patch.dict('os.environ', {}, clear=True) # Clear environment variables
2628
mocker.patch("transformers.AutoModelForSeq2SeqLM.from_pretrained")
2729
mocker.patch("transformers.AutoConfig.from_pretrained", return_value=conf)
2830
mocker.patch("transformers.AutoTokenizer.from_pretrained")

0 commit comments

Comments
 (0)