@@ -56,7 +56,7 @@ def package(
56
56
show_default = False ,
57
57
),
58
58
verbose : bool = typer .Option (False , help = "show traceback of exceptions" ),
59
- ) -> int :
59
+ ):
60
60
# typer bug: typer returns empty tuple instead of None if weights_order_priority is not given
61
61
weights_priority_order = weights_priority_order or None
62
62
@@ -85,7 +85,7 @@ def test_model(
85
85
weight_format : Optional [WeightFormatEnum ] = typer .Option (None , help = "The weight format to use." ),
86
86
devices : Optional [List [str ]] = typer .Option (None , help = "Devices for running the model." ),
87
87
decimal : int = typer .Option (4 , help = "The test precision." ),
88
- ) -> int :
88
+ ):
89
89
# this is a weird typer bug: default devices are empty tuple although they should be None
90
90
if len (devices ) == 0 :
91
91
devices = None
@@ -126,7 +126,7 @@ def test_resource(
126
126
weight_format : Optional [WeightFormatEnum ] = typer .Option (None , help = "(for model only) The weight format to use." ),
127
127
devices : Optional [List [str ]] = typer .Option (None , help = "(for model only) Devices for running the model." ),
128
128
decimal : int = typer .Option (4 , help = "(for model only) The test precision." ),
129
- ) -> int :
129
+ ):
130
130
# this is a weird typer bug: default devices are empty tuple although they should be None
131
131
if len (devices ) == 0 :
132
132
devices = None
@@ -164,7 +164,7 @@ def predict_image(
164
164
tiling : Optional [bool ] = typer .Option (None , help = "Whether to run prediction in tiling mode." ),
165
165
weight_format : Optional [WeightFormatEnum ] = typer .Option (None , help = "The weight format to use." ),
166
166
devices : Optional [List [str ]] = typer .Option (None , help = "Devices for running the model." ),
167
- ) -> int :
167
+ ):
168
168
169
169
if isinstance (padding , str ):
170
170
padding = json .loads (padding .replace ("'" , '"' ))
@@ -203,7 +203,7 @@ def predict_images(
203
203
tiling : Optional [bool ] = typer .Option (None , help = "Whether to run prediction in tiling mode." ),
204
204
weight_format : Optional [WeightFormatEnum ] = typer .Option (None , help = "The weight format to use." ),
205
205
devices : Optional [List [str ]] = typer .Option (None , help = "Devices for running the model." ),
206
- ) -> int :
206
+ ):
207
207
input_files = glob (input_pattern )
208
208
input_names = [os .path .split (infile )[1 ] for infile in input_files ]
209
209
output_files = [os .path .join (output_folder , fname ) for fname in input_names ]
@@ -246,7 +246,7 @@ def convert_torch_weights_to_onnx(
246
246
opset_version : Optional [int ] = typer .Argument (12 , help = "Onnx opset version." ),
247
247
use_tracing : bool = typer .Option (True , help = "Whether to use torch.jit tracing or scripting." ),
248
248
verbose : bool = typer .Option (True , help = "Verbosity" ),
249
- ) -> int :
249
+ ):
250
250
ret_code = torch_converter .convert_weights_to_onnx (model_rdf , output_path , opset_version , use_tracing , verbose )
251
251
sys .exit (ret_code )
252
252
@@ -259,7 +259,7 @@ def convert_torch_weights_to_torchscript(
259
259
),
260
260
output_path : Path = typer .Argument (..., help = "Where to save the torchscript weights." ),
261
261
use_tracing : bool = typer .Option (True , help = "Whether to use torch.jit tracing or scripting." ),
262
- ) -> int :
262
+ ):
263
263
ret_code = torch_converter .convert_weights_to_torchscript (model_rdf , output_path , use_tracing )
264
264
sys .exit (ret_code )
265
265
@@ -274,7 +274,7 @@ def convert_keras_weights_to_tensorflow(
274
274
..., help = "Path to the model resource description file (rdf.yaml) or zipped model."
275
275
),
276
276
output_path : Path = typer .Argument (..., help = "Where to save the tensorflow weights." ),
277
- ) -> int :
277
+ ):
278
278
ret_code = keras_converter .convert_weights_to_tensorflow_saved_model_bundle (model_rdf , output_path )
279
279
sys .exit (ret_code )
280
280
0 commit comments