From ba08e0f691724aaa1bf513c981bb78e272cd6c74 Mon Sep 17 00:00:00 2001 From: "Tung D. Le" Date: Fri, 8 Nov 2024 13:10:35 +0900 Subject: [PATCH] RunONNXModel.py: allow to change the default model name (#2999) * Allow to change the default model name Signed-off-by: Tung D. Le * Add -o as an alternative option Signed-off-by: Tung D. Le --------- Signed-off-by: Tung D. Le --- utils/RunONNXModel.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/utils/RunONNXModel.py b/utils/RunONNXModel.py index 24ab67220a..56c2b603cb 100755 --- a/utils/RunONNXModel.py +++ b/utils/RunONNXModel.py @@ -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", @@ -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: