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
5 changes: 3 additions & 2 deletions dspy/propose/grounded_proposer.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,8 +304,8 @@ def propose_instructions_for_program(
use_history = random.random() < 0.5
self.use_instruct_history = use_history
if self.verbose: print(f"Use history T/F: {self.use_instruct_history}")
num_demos = min(len(demo_candidates[0]) if demo_candidates else N, 1)

num_demos = max(len(demo_candidates[0]) if demo_candidates else N, 1)

if not demo_candidates:
if self.verbose: print("No demo candidates provided. Running without task demos.")
Expand Down Expand Up @@ -339,6 +339,7 @@ def propose_instructions_for_program(
tip=selected_tip,
),
)

return proposed_instructions

def propose_instruction_for_predictor(
Expand Down