Skip to content

Commit 99cd9dc

Browse files
fix tests for context extractor
1 parent e504c87 commit 99cd9dc

File tree

3 files changed

+73
-63
lines changed

3 files changed

+73
-63
lines changed

codeflash/models/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ class CodeStringsMarkdown(BaseModel):
154154
def __str__(self) -> str:
155155
if self.cached_code is not None:
156156
return self.cached_code
157-
self.cached_code = "\n\n".join(
157+
self.cached_code = "\n".join(
158158
get_code_block_splitter(block.file_path) + "\n" + block.code for block in self.code_strings
159159
)
160160
return self.cached_code

codeflash/optimization/function_optimizer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ def determine_best_candidate(
376376
ai_service_client = self.aiservice_client if exp_type == "EXP0" else self.local_aiservice_client
377377
future_line_profile_results = executor.submit(
378378
ai_service_client.optimize_python_code_line_profiler,
379-
source_code=code_context.read_writable_code,
379+
source_code=code_context.read_writable_code.__str__,
380380
dependency_code=code_context.read_only_context_code,
381381
trace_id=self.function_trace_id[:-4] + exp_type if self.experiment_id else self.function_trace_id,
382382
line_profiler_results=original_code_baseline.line_profile_results["str_out"],

0 commit comments

Comments
 (0)