Skip to content

Commit e86d276

Browse files
committed
🔀 Merge develop into test-cleanup
2 parents 171352a + d173a8c commit e86d276

File tree

5 files changed

+90
-80
lines changed

5 files changed

+90
-80
lines changed

requirements/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ filelock>=3.9.0
99
flask>=2.2.2
1010
flask-cors>=4.0.0
1111
glymur>=0.12.7
12+
huggingface_hub>=0.33.3
1213
imagecodecs>=2022.9.26
1314
joblib>=1.1.1
1415
jupyterlab>=3.5.2

tests/test_utils.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1628,21 +1628,24 @@ def test_from_multi_head_dat_type_dict(track_tmp_path: Path) -> None:
16281628

16291629
def 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

0 commit comments

Comments
 (0)