(self)
| 182 | self.assertFalse(hasattr(PeftModel, '_from_pretrained_origin')) |
| 183 | |
| 184 | def test_patch_file_exists(self): |
| 185 | with patch_context(): |
| 186 | from huggingface_hub import file_exists |
| 187 | self.assertTrue( |
| 188 | file_exists('AI-ModelScope/stable-diffusion-v1-5', |
| 189 | 'feature_extractor/preprocessor_config.json')) |
| 190 | try: |
| 191 | # Import again |
| 192 | from huggingface_hub import file_exists # noqa |
| 193 | exists = file_exists('AI-ModelScope/stable-diffusion-v1-5', |
| 194 | 'feature_extractor/preprocessor_config.json') |
| 195 | except Exception: |
| 196 | pass |
| 197 | else: |
| 198 | self.assertFalse(exists) |
| 199 | |
| 200 | def test_patch_file_download(self): |
| 201 | with patch_context(): |
nothing calls this directly
no test coverage detected