Skip to content

Update simba.py #8125

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
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
5 changes: 4 additions & 1 deletion dspy/teleprompt/simba.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import dspy
import random
import logging
import sys

import numpy as np
from typing import Callable
Expand All @@ -22,6 +23,7 @@ def __init__(
max_demos=4,
demo_input_field_maxlen=100_000,
num_threads=None,
max_errors: int = 10,
temperature_for_sampling=0.2,
temperature_for_candidates=0.2,
):
Expand All @@ -43,6 +45,7 @@ def __init__(
self.max_demos = max_demos
self.demo_input_field_maxlen = demo_input_field_maxlen
self.num_threads = num_threads
self.max_errors = max_errors

self.temperature_for_sampling = temperature_for_sampling
self.temperature_for_candidates = temperature_for_candidates
Expand Down Expand Up @@ -118,7 +121,7 @@ def register_new_program(prog: dspy.Module, score_list: list[float]):
instance_idx = 0

# Parallel runner
run_parallel = dspy.Parallel(access_examples=False, num_threads=self.num_threads)
run_parallel = dspy.Parallel(access_examples=False, num_threads=self.num_threads, max_errors=self.max_errors)

trial_logs = {}
for batch_idx in range(self.max_steps):
Expand Down
Loading