Skip to content

Commit cb5fdf9

Browse files
Add missing require_bitsandbytes marker to CI tests (#4586)
1 parent 4a3b584 commit cb5fdf9

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

tests/test_dpo_trainer.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -642,6 +642,7 @@ def test_dpo_lora_save(self):
642642
except OSError:
643643
pytest.fail("Loading the saved peft adapter failed")
644644

645+
@require_bitsandbytes
645646
@require_peft
646647
@require_torch_gpu_if_bnb_not_multi_backend_enabled
647648
def test_dpo_lora_bf16_autocast_llama(self):

tests/test_peft_models.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,12 @@
2020

2121
from trl import AutoModelForCausalLMWithValueHead
2222

23-
from .testing_utils import TrlTestCase, require_peft, require_torch_gpu_if_bnb_not_multi_backend_enabled
23+
from .testing_utils import (
24+
TrlTestCase,
25+
require_bitsandbytes,
26+
require_peft,
27+
require_torch_gpu_if_bnb_not_multi_backend_enabled,
28+
)
2429

2530

2631
if is_peft_available():
@@ -95,6 +100,7 @@ def test_create_peft_model_from_config(self):
95100
nb_trainable_params = sum(p.numel() for p in trl_model.parameters() if p.requires_grad)
96101
assert nb_trainable_params == 905
97102

103+
@require_bitsandbytes
98104
@require_torch_gpu_if_bnb_not_multi_backend_enabled
99105
def test_create_bnb_peft_model_from_config(self):
100106
r"""

0 commit comments

Comments
 (0)