From 9c6ad7f5522ea4c80410008d405bfa27872b65c3 Mon Sep 17 00:00:00 2001 From: Elias Bermudez Date: Fri, 28 Jun 2024 20:20:54 -0700 Subject: [PATCH] Fix filepath access bug when None --- src/c++/perf_analyzer/genai-perf/genai_perf/main.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/c++/perf_analyzer/genai-perf/genai_perf/main.py b/src/c++/perf_analyzer/genai-perf/genai_perf/main.py index b43e9b4f8..7692d02e5 100755 --- a/src/c++/perf_analyzer/genai-perf/genai_perf/main.py +++ b/src/c++/perf_analyzer/genai-perf/genai_perf/main.py @@ -51,8 +51,11 @@ def create_artifacts_dirs(args: Namespace) -> None: def generate_inputs(args: Namespace, tokenizer: Tokenizer) -> None: # TODO (TMA-1759): review if add_model_name is always true - filepath, _ = args.input_file - input_filename = Path(filepath) if filepath else None + if args.input_file: + filepath, _ = args.input_file + input_filename = Path(filepath) + else: + input_filename = None add_model_name = True try: extra_input_dict = parser.get_extra_inputs_as_dict(args)