Пример #1
0
 def test_lfs_object(self):
     url = hf_bucket_url(MODEL_ID,
                         filename=WEIGHTS_NAME,
                         revision=REVISION_ID_DEFAULT)
     filepath = get_from_cache(url, force_download=True)
     metadata = filename_to_url(filepath)
     self.assertEqual(metadata, (url, f'"{PINNED_SHA256}"'))
Пример #2
0
 def test_standard_object_rev(self):
     # Same object, but different revision
     url = hf_bucket_url(MODEL_ID,
                         filename=CONFIG_NAME,
                         revision=REVISION_ID_ONE_SPECIFIC_COMMIT)
     filepath = get_from_cache(url, force_download=True)
     metadata = filename_to_url(filepath)
     self.assertNotEqual(metadata[1], f'"{PINNED_SHA1}"')