DSPy: The framework for programming—not prompting—language models
Python
skip unhashable module histories for mipro program proposer (#8572)
arnavsinghvi11663f932c213c
diff --git a/dspy/propose/utils.py b/dspy/propose/utils.pyindex 8fa70e3e6..454b47fc4 100644--- a/dspy/propose/utils.py+++ b/dspy/propose/utils.py@@ -166,7 +166,10 @@ def get_dspy_source_code(module):iterable = [getattr(module, attribute)]for item in iterable:- if item in completed_set:+ # Skip items that are unhashable (like module history)+ try:+ hash(item)+ except TypeError:continueif isinstance(item, Parameter):if hasattr(item, "signature") and item.signature is not None and item.signature.__pydantic_parent_namespace__["signature_name"] + "_sig" not in completed_set: