Skip to content

Commit 7329d22

Browse files
committed
fix weight-format CLI arg
1 parent 3ac62bf commit 7329d22

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

bioimageio/core/commands.py

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
from typing_extensions import Literal
88

9-
from bioimageio.core.common import SupportedWeightsFormat
109
from bioimageio.spec import (
1110
InvalidDescr,
1211
ResourceDescr,
@@ -17,8 +16,27 @@
1716

1817
from ._resource_tests import test_description
1918

20-
WeightFormatArgAll = Literal[SupportedWeightsFormat, "all"]
21-
WeightFormatArgAny = Literal[SupportedWeightsFormat, "any"]
19+
# unfortunately this does not work with py3.9 and pydantic 2.11
20+
# from bioimageio.core.common import SupportedWeightsFormat
21+
# WeightFormatArgAll = Literal[SupportedWeightsFormat, "all"]
22+
# WeightFormatArgAny = Literal[SupportedWeightsFormat, "any"]
23+
# so we write out the literal explicitly
24+
WeightFormatArgAll = Literal[
25+
"keras_hdf5",
26+
"onnx",
27+
"pytorch_state_dict",
28+
"tensorflow_saved_model_bundle",
29+
"torchscript",
30+
"all",
31+
]
32+
WeightFormatArgAny = Literal[
33+
"keras_hdf5",
34+
"onnx",
35+
"pytorch_state_dict",
36+
"tensorflow_saved_model_bundle",
37+
"torchscript",
38+
"any",
39+
]
2240

2341

2442
def test(

0 commit comments

Comments
 (0)