Skip to content

armgit / dspy

Public Imported from GitHub
0

DSPy: The framework for programming—not prompting—language models

Python

Merge branch 'main' of github.com:stanfordnlp/dspy into kristaoo

klopsahlongdf479490d59c
diff --cc dspy/propose/grounded_proposer.py
index 1745d9254,2f50b8a53..1378d6ca9
--- a/dspy/propose/grounded_proposer.py
+++ b/dspy/propose/grounded_proposer.py
@@@ -191,10 -189,10 +191,10 @@@ class GenerateModuleInstruction(dspy.Mo
program_code=self.program_code_string, program_example=task_demos,
).program_description,
)
- print(f"PROGRAM DESCRIPTION: {program_description}")
+ if self.verbose: print(f"PROGRAM DESCRIPTION: {program_description}")
# Identify all modules
- init_pattern = r"def __init__\(.*?\):([\s\S]*?)(?=^\s*def|\Z)"
+ init_pattern = r"def __init__\([\s\S]*?\):([\s\S]*?)(?=^\s*def|\Z)"
init_content_match = re.search(init_pattern, self.program_code_string)
init_content = init_content_match.group(0)
pattern = r"^(.*dspy\.(ChainOfThought|Predict).*)$" # TODO: make it so that this extends out to any dspy Module