Closed eelang-sc closed 1 month ago
https://github.com/stanfordnlp/dspy/blob/d8b8909773fc31e72cec093db2f26109590e524e/dspy/propose/grounded_proposer.py#L195C1-L197C55
The init pattern finds the Predict init first (instead of the intended dspy module's init) and that will lead to finding no matches in line 201 and thus a list index error in line 203.
class Predict(Module, Parameter): def __init__(self, signature, **config): self.stage = random.randbytes(8).hex() self.signature = ensure_signature(signature) self.config = config self.reset()
I solved it for myself temporarily replacing
init_content_match = re.search(init_pattern, self.program_code_string) init_content = init_content_match.group(0)
with
init_content_match = re.findall(init_pattern, self.program_code_string) init_content = init_content_match[-1]
but that's just a quick patch/hack.
cc @XenonMolecule @arnavsinghvi11 is this something we fixed recently?
fixed
https://github.com/stanfordnlp/dspy/blob/d8b8909773fc31e72cec093db2f26109590e524e/dspy/propose/grounded_proposer.py#L195C1-L197C55
The init pattern finds the Predict init first (instead of the intended dspy module's init) and that will lead to finding no matches in line 201 and thus a list index error in line 203.
I solved it for myself temporarily replacing
with
but that's just a quick patch/hack.