Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(dspy): fix langchain predict (#1091) #1092

Merged
merged 1 commit into from
Jun 4, 2024

Conversation

dat-boris
Copy link
Contributor

Sharing a quick patch for #1091

Error seen while running https://github.com/stanfordnlp/dspy/blob/main/examples/tweets/compiling_langchain.ipynb

File ~/dspy/teleprompt/bootstrap.py:115, in BootstrapFewShot._prepare_predictor_mappings(self)
    113 for (name1, predictor1), (name2, predictor2) in zip(student.named_predictors(), teacher.named_predictors()):
    114     assert name1 == name2, "Student and teacher must have the same program structure."
--> 115     assert predictor1.signature.equals(
    116         predictor2.signature,
    117     ), (f"Student and teacher must have the same signatures. "
    118         f"{type(predictor1.signature)} != {type(predictor2.signature)}"
    119         )
    120     assert id(predictor1) != id(predictor2), "Student and teacher must be different objects."
    122     name2predictor[name1] = None  # dict(student=predictor1, teacher=predictor2)

AttributeError: 'Template' object has no attribute 'equals'

@okhat
Copy link
Collaborator

okhat commented Jun 4, 2024

Ahh wonderful, thank you @dat-boris

@okhat okhat merged commit 183564f into stanfordnlp:main Jun 4, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants