Skip to content

Commit

Permalink
Merge pull request #378 from jdeschamps/fix_hash_pytorch
Browse files Browse the repository at this point in the history
Fix pytorch_state_dict import from library
  • Loading branch information
FynnBe authored Apr 25, 2024
2 parents ff8af21 + 7681ab7 commit 60b1625
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions bioimageio/core/digest_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from numpy.typing import NDArray
from typing_extensions import Unpack, assert_never

from bioimageio.spec._internal.io_utils import HashKwargs, download
from bioimageio.spec._internal.io import HashKwargs, download
from bioimageio.spec.common import FileSource
from bioimageio.spec.model import AnyModelDescr, v0_4, v0_5
from bioimageio.spec.model.v0_4 import CallableFromDepencency, CallableFromFile
Expand Down Expand Up @@ -51,7 +51,7 @@ def import_callable(node: type, /) -> Callable[..., Any]:


@import_callable.register
def _(node: CallableFromDepencency) -> Callable[..., Any]:
def _(node: CallableFromDepencency, **kwargs: Unpack[HashKwargs]) -> Callable[..., Any]:
module = importlib.import_module(node.module_name)
c = getattr(module, str(node.callable_name))
if not callable(c):
Expand All @@ -61,7 +61,9 @@ def _(node: CallableFromDepencency) -> Callable[..., Any]:


@import_callable.register
def _(node: ArchitectureFromLibraryDescr) -> Callable[..., Any]:
def _(
node: ArchitectureFromLibraryDescr, **kwargs: Unpack[HashKwargs]
) -> Callable[..., Any]:
module = importlib.import_module(node.import_from)
c = getattr(module, str(node.callable))
if not callable(c):
Expand Down

0 comments on commit 60b1625

Please sign in to comment.