stanfordnlp / dspy

DSPy: The framework for programming—not prompting—language models
https://dspy.ai
MIT License
19.27k stars 1.47k forks source link

Fix MIPROv2 exception on demoless runs #1581

Closed XenonMolecule closed 1 month ago

XenonMolecule commented 1 month ago

Fixes #1580

When an exception occurs during bootstrapping demos, MIPROv2 switches to running without task demonstrations. However, MIPROv2 previously did not have support for running without demos. This PR adds checks so that running without demos will not cause MIPROv2 to crash and instead gracefully adds "No task demos provided." to the meta prompt.