Skip to content

Commit c3a5eef

Browse files
committed
handle benchmark case properly
1 parent 2dafa8e commit c3a5eef

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

codeflash/optimization/optimizer.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def run_benchmarks(
5353
function_benchmark_timings: dict[str, dict[BenchmarkKey, float]] = {}
5454
total_benchmark_timings: dict[BenchmarkKey, float] = {}
5555

56-
if not (self.args.benchmark and num_optimizable_functions > 0):
56+
if not (hasattr(self.args, "benchmark") and self.args.benchmark and num_optimizable_functions > 0):
5757
return function_benchmark_timings, total_benchmark_timings
5858

5959
from codeflash.benchmarking.instrument_codeflash_trace import instrument_codeflash_trace_decorator
@@ -215,7 +215,8 @@ def create_function_optimizer(
215215

216216
function_specific_timings = None
217217
if (
218-
self.args.benchmark
218+
hasattr(self.args, "benchmark")
219+
and self.args.benchmark
219220
and function_benchmark_timings
220221
and qualified_name_w_module in function_benchmark_timings
221222
and total_benchmark_timings

0 commit comments

Comments
 (0)