Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions codeflash/optimization/function_optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -649,16 +649,14 @@ def determine_best_candidate(
if self.args.benchmark and benchmark_tree:
console.print(benchmark_tree)
console.rule()

self.write_code_and_helpers(
self.function_to_optimize_source_code, original_helper_code, self.function_to_optimize.file_path
)
except KeyboardInterrupt as e:
logger.exception(f"Optimization interrupted: {e}")
raise
finally:
# reset for the next candidate
self.write_code_and_helpers(
self.function_to_optimize_source_code, original_helper_code, self.function_to_optimize.file_path
)
logger.exception(f"Optimization interrupted: {e}")
raise
if not valid_optimizations:
return None
# need to figure out the best candidate here before we return best_optimization
Expand Down
Loading