|
14 | 14 |
|
15 | 15 | def test_finetune_dump_load(dataset, on_windows): |
16 | 16 | """Test scenario: fine-tune -> dump -> load.""" |
| 17 | + pytest.importorskip("accelerate", reason="Accelerate library is required for this test") |
| 18 | + |
17 | 19 | data_handler = DataHandler(dataset) |
18 | 20 |
|
19 | 21 | # Setup config for fine-tuning |
@@ -69,6 +71,8 @@ def test_finetune_dump_load(dataset, on_windows): |
69 | 71 |
|
70 | 72 | def test_dump_load_finetune(dataset, on_windows): |
71 | 73 | """Test scenario: dump -> load -> fine-tune.""" |
| 74 | + pytest.importorskip("accelerate", reason="Accelerate library is required for this test") |
| 75 | + |
72 | 76 | data_handler = DataHandler(dataset) |
73 | 77 |
|
74 | 78 | # Setup config |
@@ -121,6 +125,8 @@ def test_dump_load_finetune(dataset, on_windows): |
121 | 125 |
|
122 | 126 | def test_load_from_disk_finetune_dump_load(dataset, on_windows): |
123 | 127 | """Test scenario: load sentence transformer from disk -> fine-tune -> dump -> load.""" |
| 128 | + pytest.importorskip("accelerate", reason="Accelerate library is required for this test") |
| 129 | + |
124 | 130 | from sentence_transformers import SentenceTransformer |
125 | 131 |
|
126 | 132 | data_handler = DataHandler(dataset) |
@@ -180,6 +186,8 @@ def test_load_from_disk_finetune_dump_load(dataset, on_windows): |
180 | 186 |
|
181 | 187 | def test_embeddings_consistency_across_workflows(dataset, on_windows): |
182 | 188 | """Test that different workflows produce consistent results when starting from same model.""" |
| 189 | + pytest.importorskip("accelerate", reason="Accelerate library is required for this test") |
| 190 | + |
183 | 191 | data_handler = DataHandler(dataset) |
184 | 192 |
|
185 | 193 | # Common config |
@@ -224,6 +232,7 @@ def test_embeddings_consistency_across_workflows(dataset, on_windows): |
224 | 232 |
|
225 | 233 | def test_multiple_dump_load_cycles_after_finetuning(dataset, on_windows): |
226 | 234 | """Test that multiple dump/load cycles preserve fine-tuned model state.""" |
| 235 | + pytest.importorskip("accelerate", reason="Accelerate library is required for this test") |
227 | 236 | data_handler = DataHandler(dataset) |
228 | 237 |
|
229 | 238 | hf_config = HFModelConfig(model_name="intfloat/multilingual-e5-small", batch_size=4, trust_remote_code=True) |
|
0 commit comments