stanfordnlp / dspy

DSPy: The framework for programming—not prompting—foundation models
https://dspy-docs.vercel.app/
MIT License
13.82k stars 1.06k forks source link

Fixed Bug - MIPROv2 fails when program_aware_proposer parameter set to False #1202

Closed shubham-skr closed 4 days ago

shubham-skr commented 6 days ago

If program_aware_proposer parameter is set to False when compiling the program with MIPROv2 optimizer, it results in the following error - AttributeError: 'MIPROv2' object has no attribute 'program_code_string'.

The error occurs on line no. 220 when program_code_string in GroundedProposer is assigned. It is due to program_code_string not set to None if program_aware_proposer is false.

image
XenonMolecule commented 4 days ago

This fix looks both good and minimal; thanks, @shubham-skr!