|
63 | 63 |
|
64 | 64 | TEST_CASE_6 = [["models/model.pt", "configs/train.json"], "renalStructures_CECT_segmentation", "0.1.0"] |
65 | 65 |
|
| 66 | +TEST_CASE_6_HF = [["models/model.pt", "configs/train.yaml"], "mednist_ddpm", "1.0.1"] |
| 67 | + |
66 | 68 | TEST_CASE_7 = [ |
67 | 69 | ["model.pt", "model.ts", "network.json", "test_output.pt", "test_input.pt"], |
68 | 70 | "test_bundle", |
@@ -193,6 +195,7 @@ def test_ngc_private_source_download_bundle(self, bundle_files, bundle_name, _ur |
193 | 195 |
|
194 | 196 | @parameterized.expand([TEST_CASE_6]) |
195 | 197 | @skip_if_quick |
| 198 | + @skipUnless(has_huggingface_hub, "Requires `huggingface_hub`.") |
196 | 199 | def test_monaihosting_source_download_bundle(self, bundle_files, bundle_name, version): |
197 | 200 | with skip_if_downloading_fails(): |
198 | 201 | # download a single file from url, also use `args_file` |
@@ -239,6 +242,7 @@ def test_list_latest_versions(self): |
239 | 242 | self.assertEqual(_list_latest_versions(data), ["1.1", "1.0"]) |
240 | 243 |
|
241 | 244 | @skip_if_quick |
| 245 | + @skipUnless(has_huggingface_hub, "Requires `huggingface_hub`.") |
242 | 246 | @patch("monai.bundle.scripts.get_versions", return_value={"version": "1.2"}) |
243 | 247 | def test_download_monaihosting(self, mock_get_versions): |
244 | 248 | """Test checking MONAI version from a metadata file.""" |
@@ -333,6 +337,7 @@ def test_load_weights(self, bundle_files, bundle_name, repo, device, model_file) |
333 | 337 |
|
334 | 338 | @parameterized.expand([TEST_CASE_8]) |
335 | 339 | @skip_if_quick |
| 340 | + @skipUnless(has_huggingface_hub, "Requires `huggingface_hub`.") |
336 | 341 | def test_load_weights_with_net_override(self, bundle_name, device, net_override): |
337 | 342 | with skip_if_downloading_fails(): |
338 | 343 | # download bundle, and load weights from the downloaded path |
|
0 commit comments