(self)
| 166 | |
| 167 | @unittest.skipUnless(test_level() >= 1, 'skip test in current test level') |
| 168 | def test_patch_peft(self): |
| 169 | with patch_context(): |
| 170 | from transformers import AutoModelForCausalLM |
| 171 | from peft import PeftModel |
| 172 | model = AutoModelForCausalLM.from_pretrained( |
| 173 | 'Qwen/Qwen1.5-0.5B-Chat', |
| 174 | trust_remote_code=True, |
| 175 | torch_dtype=torch.float32) |
| 176 | model = PeftModel.from_pretrained( |
| 177 | model, |
| 178 | 'tastelikefeet/test_lora', |
| 179 | trust_remote_code=True, |
| 180 | torch_dtype=torch.float32) |
| 181 | self.assertTrue(model is not None) |
| 182 | self.assertFalse(hasattr(PeftModel, '_from_pretrained_origin')) |
| 183 | |
| 184 | def test_patch_file_exists(self): |
| 185 | with patch_context(): |
nothing calls this directly
no test coverage detected