Skip to content

Commit

Permalink
Merge pull request stanfordnlp#1630 from stanfordnlp/multi_chain_patch
Browse files Browse the repository at this point in the history
add support for reasoning/rationale
  • Loading branch information
arnavsinghvi11 authored Oct 15, 2024
2 parents 6c6db52 + fb907fc commit 0bb9526
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dspy/predict/multi_chain_comparison.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def forward(self, completions, **kwargs):
attempts = []

for c in completions:
rationale = c.rationale.strip().split("\n")[0].strip()
rationale = c.get('rationale', c.get('reasoning')).strip().split("\n")[0].strip()
answer = c[self.last_key].strip().split("\n")[0].strip()
attempts.append(
f"«I'm trying to {rationale} I'm not sure but my prediction is {answer}»",
Expand Down

0 comments on commit 0bb9526

Please sign in to comment.