Skip to content

Commit af396aa

Browse files
committed
various fixes
1 parent ed3e38d commit af396aa

File tree

5 files changed

+12
-7
lines changed

5 files changed

+12
-7
lines changed

bioimageio/core/_resource_tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ def load_description_and_test(
428428
)
429429
)
430430
or (c := source.validation_summary.details[0].context) is None
431-
or not c["perform_io_checks"]
431+
or not c.perform_io_checks
432432
):
433433
logger.debug(
434434
"deserializing source to ensure we validate and test using format {} and perform io checks",

bioimageio/core/backends/onnx_backend.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,8 @@ def __init__(
2323
if model_description.weights.onnx is None:
2424
raise ValueError("No ONNX weights specified for {model_description.name}")
2525

26-
self._session = rt.InferenceSession(
27-
str(download(model_description.weights.onnx.source).path)
28-
)
26+
local_path = download(model_description.weights.onnx.source).path
27+
self._session = rt.InferenceSession(local_path.read_bytes())
2928
onnx_inputs = self._session.get_inputs() # type: ignore
3029
self._input_names: List[str] = [ipt.name for ipt in onnx_inputs] # type: ignore
3130

bioimageio/core/backends/torchscript_backend.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ def __init__(
3636
"Multiple devices for single torchscript model not yet implemented"
3737
)
3838

39-
self._model = torch.jit.load(weight_path)
39+
with weight_path.open("rb") as f:
40+
self._model = torch.jit.load(f)
41+
4042
self._model.to(self.devices[0])
4143
self._model = self._model.eval()
4244

tests/test_bioimageio_collection.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ def yield_bioimageio_yaml_urls() -> Iterable[ParameterSet]:
4343
"wild-rhino/0.1.0", # requires careamics
4444
"dazzling-spider/0.1.0", # requires careamics
4545
"humorous-fox/0.1.0", # requires careamics
46+
"ambitious-sloth/1.2", # requires inferno
47+
"dynamic-t-rex/1", # model.v0_4.ScaleLinearKwargs with axes
48+
"famous-fish/0.1.0", # list index out of range `fl[3]`
49+
"happy-elephant/0.1.0", # list index out of range `fl[3]`
50+
"affectionate-cow/0.1.0", # custom dependencies
4651
}
4752

4853

tests/test_stat_calculators.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
from typing import Tuple
1+
from typing import Optional, Tuple
22

33
import numpy as np
44
import pytest
5-
from git import Optional
65
from xarray.testing import assert_allclose # pyright: ignore[reportUnknownVariableType]
76

87
from bioimageio.core.axis import AxisId

0 commit comments

Comments
 (0)