Skip to content

Commit

Permalink
Merge branch 'main' into pdl-132
Browse files Browse the repository at this point in the history
  • Loading branch information
mandel committed Sep 11, 2024
2 parents 9e28ab8 + 0c74102 commit 2711b42
Show file tree
Hide file tree
Showing 11 changed files with 467 additions and 442 deletions.
20 changes: 14 additions & 6 deletions examples/arith/Arith-simple.pdl
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,30 @@ document:
- repeat:
document:
- def: REASON_OR_CALC
model: ibm/granite-20b-code-instruct
params:
stop_sequences:
model: watsonx/ibm/granite-20b-code-instruct
parameters:
stop:
- '<<'
include_stop_sequence: true
roles:
user:
pre_message: ""
post_message: ""
- if: '{{ REASON_OR_CALC.endswith("<<") }}'
then:
document:
- def: EXPR
model: ibm/granite-20b-code-instruct
params:
stop_sequences:
model: watsonx/ibm/granite-20b-code-instruct
parameters:
stop:
- '='
- "\n"
- "Question"
include_stop_sequence: false
roles:
user:
pre_message: ""
post_message: ""
- '= '
- def: RESULT
lan: python
Expand Down
25 changes: 13 additions & 12 deletions examples/chatbot/chatbot.pdl
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,20 @@ document:
- read:
message: "What is your query?\n"
- repeat:
- model: ibm/granite-13b-chat-v2
spec: str
params:
stop_sequences: ["."]
- read:
def: eval
message: "\nIs this a good answer[yes/no]?\n"
contribute: []
- if: "{{ eval == 'no' }}"
then:
- read:
message: "Why not?\n"
document:
- model: watsonx/ibm/granite-13b-chat-v2
- read:
def: eval
message: "\nIs this a good answer[yes/no]?\n"
contribute: []
- if: "{{ eval == 'no' }}"
then:
document:
- read:
message: "Why not?\n"
until: "{{ eval == 'yes'}}"
as: document
role: user



2 changes: 1 addition & 1 deletion examples/hello/hello-code.pdl
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ document:
import string
result = random.choice(string.ascii_lowercase)
- '!'
- "\n"

6 changes: 3 additions & 3 deletions examples/hello/hello-def-use.pdl
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
description: Hello world with variable use
document:
- Hello,
- model: ibm/granite-34b-code-instruct
params:
- model: watsonx/ibm/granite-34b-code-instruct
parameters:
decoding_method: greedy
stop_sequences:
stop:
- '!'
include_stop_sequence: false
def: NAME
Expand Down
4 changes: 3 additions & 1 deletion examples/hello/hello-iteration.pdl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ document:
- Hello, world!
- "\n"
- repeat:
"This is your first PDL program\n"
document:
"This is your first PDL program\n"
as: document
num_iterations: 3
- "\n"
4 changes: 2 additions & 2 deletions examples/hello/hello-litellm.pdl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ document:
- Hello,
- model: watsonx/ibm/granite-34b-code-instruct
parameters:
decoding_method: greedy
stop:
- ","
- "\n"
- "!"
22 changes: 13 additions & 9 deletions examples/hello/hello-model-chaining.pdl
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
description: Hello world showing model chaining
document:
- Hello,
- model: ibm/granite-34b-code-instruct
params:
- model: watsonx/ibm/granite-34b-code-instruct
parameters:
decoding_method: greedy
stop_sequences:
stop:
- '!'
include_stop_sequence: false
def: NAME
- |-
!
Who is{{ NAME }}?
- "\n"
- model: google/flan-t5-xl
params:
- model: watsonx/google/flan-t5-xl
#model: watsonx/ibm/granite-34b-code-instruct
parameters:
decoding_method: greedy
stop_sequences:
- '!'
include_stop_sequence: false
- "\n"
stop:
- '.'
include_stop_sequence: true
roles:
user:
pre_message: ""
post_message: ""
8 changes: 4 additions & 4 deletions examples/hello/hello.pdl
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
description: Hello world
document:
- Hello,
- model: ibm/granite-34b-code-instruct
params:
stop_sequences:
- model: watsonx/ibm/granite-34b-code-instruct
parameters:
decoding_method: greedy
stop:
- '!'
include_stop_sequence: true
- "\n"
Loading

0 comments on commit 2711b42

Please sign in to comment.