Skip to content

Commit bbc3581

Browse files
okhatklopsahlong
andcommitted
Fixing SIMBA max recursion depth error
Co-authored-by: Krista Opsahl-Ong <krista.opsahl-ong@databricks.com>
1 parent 56d7f89 commit bbc3581

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

dspy/teleprompt/simba.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ def register_new_program(prog: dspy.Module, score_list: list[float]):
310310
trial_logs[idx_prog-1]["train_score"] = avg_score
311311

312312
best_idx = scores.index(max(scores)) if scores else 0
313-
best_program = candidate_programs[best_idx]
313+
best_program = candidate_programs[best_idx].deepcopy()
314314
logger.info(
315315
f"Final trainset scores: {scores}, Best: {max(scores) if scores else 'N/A'} "
316316
f"(at index {best_idx if scores else 'N/A'})\n\n\n"

0 commit comments

Comments
 (0)