Skip to content

Commit

Permalink
RunONNXModel.py: allow to change the default model name (#2999)
Browse files Browse the repository at this point in the history
* Allow to change the default model name

Signed-off-by: Tung D. Le <[email protected]>

* Add -o as an alternative option

Signed-off-by: Tung D. Le <[email protected]>

---------

Signed-off-by: Tung D. Le <[email protected]>
  • Loading branch information
tungld authored Nov 8, 2024
1 parent b856fc5 commit ba08e0f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion utils/RunONNXModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,16 @@ def check_non_negative(argname, value):
"Otherwise, compile model and save it into the given path.",
)

parser.add_argument(
"-o",
"--default-model-name",
metavar="MODEL_NAME",
type=str,
default="model",
help="Change the default model name that is used for two generated files: "
" .so and .constants.bin. Default is model.",
)

parser.add_argument(
"--save-ref",
metavar="PATH",
Expand Down Expand Up @@ -645,7 +655,7 @@ def __init__(self, model_file, **kwargs):

# Default model name that will be used for the compiled model.
# e.g. model.so, model.constants.bin, ...
self.default_model_name = "model"
self.default_model_name = args.default_model_name

# Handle cache_model.
if args.cache_model:
Expand Down

0 comments on commit ba08e0f

Please sign in to comment.