File tree Expand file tree Collapse file tree 5 files changed +90
-80
lines changed
Expand file tree Collapse file tree 5 files changed +90
-80
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ filelock>=3.9.0
99flask >= 2.2.2
1010flask-cors >= 4.0.0
1111glymur >= 0.12.7
12+ huggingface_hub >= 0.33.3
1213imagecodecs >= 2022.9.26
1314joblib >= 1.1.1
1415jupyterlab >= 3.5.2
Original file line number Diff line number Diff line change @@ -1628,21 +1628,24 @@ def test_from_multi_head_dat_type_dict(track_tmp_path: Path) -> None:
16281628
16291629def test_fetch_pretrained_weights (track_tmp_path : Path ) -> None :
16301630 """Test fetching pretrained weights for a model."""
1631- file_path = track_tmp_path / "test_fetch_pretrained_weights.pth"
1631+ model_name = "mobilenet_v3_small-pcam"
1632+ file_path = track_tmp_path / f"{ model_name } .pth"
16321633 if file_path .exists ():
16331634 file_path .unlink ()
16341635
1635- fetch_pretrained_weights (model_name = "mobilenet_v3_small-pcam" , save_path = file_path )
1636+ _ = fetch_pretrained_weights (
1637+ model_name = "mobilenet_v3_small-pcam" , save_path = track_tmp_path
1638+ )
1639+
16361640 assert file_path .exists ()
16371641 assert file_path .stat ().st_size > 0
16381642 file_path .unlink ()
16391643
16401644 with pytest .raises (ValueError , match = "does not exist" ):
1641- fetch_pretrained_weights ("abc" , file_path )
1645+ fetch_pretrained_weights ("abc" , track_tmp_path )
16421646
16431647 # Test save_path is str
1644- file_path_str = str (file_path )
1645- file_path = fetch_pretrained_weights ("mobilenet_v3_small-pcam" , file_path_str )
1648+ file_path = fetch_pretrained_weights (model_name , str (track_tmp_path ))
16461649 assert Path (file_path ).exists ()
16471650 assert Path (file_path ).stat ().st_size > 0
16481651
You can’t perform that action at this time.
0 commit comments