Skip to content

Commit

Permalink
Merge branch 'main' into pdl-95
Browse files Browse the repository at this point in the history
  • Loading branch information
mandel committed Sep 4, 2024
2 parents c1e2c4f + bbbb04e commit c0016c8
Show file tree
Hide file tree
Showing 49 changed files with 232 additions and 915 deletions.
68 changes: 0 additions & 68 deletions examples/arith/Arith-litellm.pdl

This file was deleted.

10 changes: 6 additions & 4 deletions examples/arith/Arith-new.pdl
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,27 @@ document:
- "\nQuestion: "
- def: QUESTION
model: ibm/granite-20b-code-instruct
parameters:
params:
stop_sequences:
- Answer
include_stop_sequence: false
- "Answer: Let's think step by step.\n"
- repeat:
- def: REASON_OR_CALC
model: ibm/granite-20b-code-instruct
parameters:
params:
stop_sequences:
- '<<'
include_stop_sequence: true
- if: '{{ REASON_OR_CALC.endswith("<<") }}'
then:
- def: EXPR
model: ibm/granite-20b-code-instruct-v2
parameters:
model: ibm/granite-20b-code-instruct
params:
stop_sequences:
- '='
- "\n"
- "Question"
include_stop_sequence: false
- '= '
- def: RESULT
Expand All @@ -34,4 +35,5 @@ document:
- ' >>'
until: '{{ "The answer is" in REASON_OR_CALC }}'
- "\n\n"
as: document
num_iterations: 3
33 changes: 33 additions & 0 deletions examples/arith/Arith-simple.pdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
description: Math Problems
document:
- read: examples/arith/example1.txt
- read: examples/arith/example2.txt
- "\n"
- |
Question: Noah charges $10 for a large box and $5 for a small box.
Last month he sold four large boxes and two small boxes.
If he sold half as much this month, how much is his sales for this month?
- repeat:
- def: REASON_OR_CALC
model: ibm/granite-20b-code-instruct
params:
stop_sequences:
- '<<'
include_stop_sequence: true
- if: '{{ REASON_OR_CALC.endswith("<<") }}'
then:
- def: EXPR
model: ibm/granite-20b-code-instruct
params:
stop_sequences:
- '='
- "\n"
- "Question"
include_stop_sequence: false
- '= '
- def: RESULT
lan: python
code: result = {{ EXPR }}
- ' >>'
until: '{{ "The answer is" in REASON_OR_CALC }}'
- "\n"
68 changes: 0 additions & 68 deletions examples/arith/Arith.pdl

This file was deleted.

76 changes: 0 additions & 76 deletions examples/arith/litellm.txt

This file was deleted.

67 changes: 0 additions & 67 deletions examples/arith/output.txt

This file was deleted.

Loading

0 comments on commit c0016c8

Please sign in to comment.