MCPcopy Create free account
hub / github.com/modelscope/modelscope / test_patch_file_exists

Method test_patch_file_exists

tests/utils/test_hf_util.py:184–198  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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():

Callers

nothing calls this directly

Calls 1

patch_contextFunction · 0.90

Tested by

no test coverage detected