diff --git a/scripts/inference.py b/scripts/inference.py index 2c30bcdf5..4121b1b95 100644 --- a/scripts/inference.py +++ b/scripts/inference.py @@ -133,9 +133,12 @@ def main(args_in: Optional[List[str]] = None) -> None: if is_win(): path = Path(args.build_dir, "./Bin/Release/run_{}.exe".format(model_name)) else: - import neural_speed - package_path = os.path.dirname(neural_speed.__file__) - path = Path(package_path, "./run_{}".format(model_name)) + if args.one_click_run == "True": + import neural_speed + package_path = os.path.dirname(neural_speed.__file__) + path = Path(package_path, "./run_{}".format(model_name)) + else: + path = Path(args.build_dir, "./bin/run_{}".format(model_name)) if not path.exists(): print("Please build graph first or select the correct model name.") diff --git a/scripts/quantize.py b/scripts/quantize.py index 460f8f2c3..7034675a9 100644 --- a/scripts/quantize.py +++ b/scripts/quantize.py @@ -103,9 +103,12 @@ def main(args_in: Optional[List[str]] = None) -> None: if is_win(): path = Path(args.build_dir, "./Bin/Release/quant_{}.exe".format(model_name)) else: - import neural_speed - package_path = os.path.dirname(neural_speed.__file__) - path = Path(package_path, "./quant_{}".format(model_name)) + if args.one_click_run == "True": + import neural_speed + package_path = os.path.dirname(neural_speed.__file__) + path = Path(package_path, "./quant_{}".format(model_name)) + else: + path = Path(args.build_dir, "./bin/quant_{}".format(model_name)) if not path.exists(): print(path) print("Please build graph first or select the correct model name.")