Skip to content

Commit

Permalink
Replace show_result by contribute
Browse files Browse the repository at this point in the history
  • Loading branch information
mandel committed Sep 11, 2024
1 parent dc9fa52 commit 9e28ab8
Show file tree
Hide file tree
Showing 65 changed files with 468 additions and 335 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ document:
- read: examples/code/data.yaml
parser: yaml
def: CODE
show_result: False
contribute: []
- "\n{{ CODE.source_code }}\n"
- model: meta-llama/llama-3-70b-instruct
input:
Expand Down Expand Up @@ -233,7 +233,7 @@ document:
- read: ./data.yaml
parser: yaml
def: CODE
show_result: False
contribute: []
- "\n{{ CODE.source_code }}\n"
- model: ibm/granite-34b-code-instruct
def: EXPLANATION
Expand All @@ -250,7 +250,7 @@ document:
{{ CODE.source_code }}```
- read: ./ground_truth.txt
def: TRUTH
show_result: False
contribute: []
- |
Expand Down Expand Up @@ -307,13 +307,13 @@ document:
- read: ./data.yaml
parser: yaml
def: CODE
show_result: False
contribute: []
- read: ./ground_truth.txt
def: TRUTH
show_result: False
contribute: []
- model: ibm/granite-34b-code-instruct
def: EXPLANATION
show_result: False
contribute: []
input:
|
Here is some info about the location of the function in the repo.
Expand All @@ -327,7 +327,7 @@ document:
```
{{ CODE.source_code }}```
- def: EVAL
show_result: False
contribute: []
lan: python
code:
|
Expand Down
14 changes: 7 additions & 7 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ document:
- read: ./data.json
parser: json
def: CODE
show_result: False
contribute: []
- "\n{{ CODE.source_code }}\n"
- model: ibm/granite-20b-code-instruct-v2
input:
Expand Down Expand Up @@ -215,10 +215,10 @@ document:
- read: ./data.json
parser: json
def: CODE
show_result: False
contribute: []
- read: ./ground_truth.txt
def: TRUTH
show_result: False
contribute: []
- "\n{{ CODE.source_code }}\n"
- model: ibm/granite-20b-code-instruct-v2
def: EXPLANATION
Expand Down Expand Up @@ -292,13 +292,13 @@ document:
- read: ./data.json
parser: json
def: CODE
show_result: False
contribute: []
- read: ./ground_truth.txt
def: TRUTH
show_result: False
contribute: []
- model: ibm/granite-20b-code-instruct-v2
def: EXPLANATION
show_result: False
contribute: []
parameters:
decoding_method: greedy
max_new_tokens: 1024
Expand All @@ -315,7 +315,7 @@ document:
```
{{ CODE.source_code }}```
- def: EVAL
show_result: False
contribute: []
lan: python
code:
|
Expand Down
28 changes: 14 additions & 14 deletions docs/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ document:
- "\nTranslate the sentence '{{ sentence }}' to {{ language }}\n"
- model: ibm/granite-20b-multilingual
- call: translate
show_result: false
contribute: []
def: FRENCH
args:
sentence: Hello,{{ GEN }}
Expand Down Expand Up @@ -532,7 +532,7 @@ document:
- def: NAME
document:
- model: "ibm/granite-20b-code-instruct-v2"
show_result: false # <-- MISTAKE:
contribute: [] # <-- MISTAKE:
# `show_result` is specified on the document,
# resulting in an _empty_ document and thus
# an empty `NAME`
Expand All @@ -547,7 +547,7 @@ document:
- get: NAME
- "`!\n"
- def: TWO
show_result: false # <-- CORRECT:
contribute: [] # <-- CORRECT:
# `show_result` is set at the root of the block,
# which behaves as expected.
document:
Expand Down Expand Up @@ -624,11 +624,11 @@ The following PDL program reads this content and assigns it to variable `PERSON`

```yaml
description: Input block example with json input
defs:
PERSON:
read: ./input.json
parser: json
document:
- read: examples/tutorial/input.json
parser: json
def: PERSON
show_result: false
- "{{ PERSON.name }} lives at the following address:\n"
- "{{ PERSON.address.number }} {{ PERSON.address.street }} in the town of {{ PERSON.address.town }}, {{ PERSON.address.state }}"
```
Expand Down Expand Up @@ -671,7 +671,7 @@ document:
- read:
def: QUERY
message: "Ask a query: "
show_result: false
contribute: []
- model: ibm/granite-20b-code-instruct-v2
input: |-
Question: What is the weather in London?
Expand All @@ -689,12 +689,12 @@ document:
- '!'
include_stop_sequence: false
def: LOCATION
show_result: false
contribute: []
- api: https
url: https://api.weatherapi.com/v1/current.json?key=cf601276764642cb96224947230712&q=
input: '{{ LOCATION }}'
def: WEATHER
show_result: false
contribute: []
- model: ibm/granite-20b-code-instruct-v2
input: >
Explain what the weather is from the following JSON:
Expand Down Expand Up @@ -727,13 +727,13 @@ document:
- read: examples/code/data.json
parser: json
def: CODE
show_result: False
contribute: []
- read: examples/code/ground_truth.txt
def: TRUTH
show_result: False
contribute: []
- model: ibm/granite-20b-code-instruct-v2
def: EXPLANATION
show_result: False
contribute: []
parameters:
decoding_method: greedy
max_new_tokens: 1024
Expand All @@ -750,7 +750,7 @@ document:
```
{{ CODE.source_code }}```
- def: EVAL
show_result: False
contribute: []
lan: python
code:
|
Expand Down
2 changes: 1 addition & 1 deletion examples/chatbot/chatbot.pdl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ document:
- read:
def: eval
message: "\nIs this a good answer[yes/no]?\n"
show_result: false
contribute: []
- if: "{{ eval == 'no' }}"
then:
- read:
Expand Down
11 changes: 5 additions & 6 deletions examples/cldk/cldk-assistant.pdl
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ document:
- read:
def: project
message: "Please enter the path to your Java project:\n"
show_result: false
- "***Analyzing..."
contribute: []
- "***Analyzing...\n"
- lan: python
def: analysis
show_result: false
contribute: []
code: |
import os
from rich import print # Optional, for pretty printing.
Expand All @@ -30,13 +30,12 @@ document:
- read:
def: query
message: "\n\nHow can I help you [Type 'quit' to quit]?\n"
show_result: false
contribute: []
- "\n***Generating PDL code for your query:\n"
- if: "{{ query != 'quit'}}"
then:
- model: ibm/granite-20b-code-instruct
def: PDL
show_result: true
input:
- |
Question: What are all the classes?
Expand Down Expand Up @@ -142,7 +141,7 @@ document:
include_stop_sequence: false
- "\n\n***Executing the above PDL code:\n\n"
- lan: python
show_result: false
contribute: []
code: |
from pdl import pdl_ast, pdl_interpreter
from pdl.pdl_ast import Program
Expand Down
4 changes: 2 additions & 2 deletions examples/code/code-eval.pdl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ document:
- read: ./data.yaml
parser: yaml
def: CODE
show_result: False
contribute: []
- "\n{{ CODE.source_code }}\n"
- model: ibm/granite-34b-code-instruct
def: EXPLANATION
Expand All @@ -20,7 +20,7 @@ document:
{{ CODE.source_code }}```
- read: ./ground_truth.txt
def: TRUTH
show_result: False
contribute: []
- |


Expand Down
8 changes: 4 additions & 4 deletions examples/code/code-json.pdl
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ document:
- read: ./data.yaml
parser: yaml
def: CODE
show_result: False
contribute: []
- read: ./ground_truth.txt
def: TRUTH
show_result: False
contribute: []
- model: ibm/granite-34b-code-instruct
def: EXPLANATION
show_result: False
contribute: []
input:
|
Here is some info about the location of the function in the repo.
Expand All @@ -23,7 +23,7 @@ document:
```
{{ CODE.source_code }}```
- def: EVAL
show_result: False
contribute: []
lan: python
code:
|
Expand Down
9 changes: 4 additions & 5 deletions examples/code/code.pdl
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
description: Code explanation example
defs:
CODE:
read: ./data.yaml
parser: yaml
document:
- read: ./data.yaml
parser: yaml
def: CODE
show_result: False
- "\n{{ CODE.source_code }}\n"
- model: ibm/granite-34b-code-instruct
input:
Expand All @@ -17,4 +17,3 @@ document:
Explain the following code:
```
{{ CODE.source_code }}```
- "\n"
6 changes: 3 additions & 3 deletions examples/demo/3-weather.pdl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ document:
- read:
def: QUERY
message: "Ask a query: "
show_result: false
contribute: []
- model: ibm/granite-34b-code-instruct
input: |
Question: What is the weather in London?
Expand All @@ -20,12 +20,12 @@ document:
- '!'
include_stop_sequence: false
def: LOCATION
show_result: false
contribute: []
- api: https
url: https://api.weatherapi.com/v1/current.json?key=cf601276764642cb96224947230712&q=
input: '{{ LOCATION }}'
def: WEATHER
show_result: false
contribute: []
- model: ibm/granite-20b-code-instruct
input: |
Explain the weather from the following JSON.
Expand Down
8 changes: 4 additions & 4 deletions examples/demo/4-arith-detector.pdl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ document:
- read:
multiline: True
def: QUERY
show_result: false
contribute: []
- model: ibm/granite-20b-code-instruct
input:
document:
Expand Down Expand Up @@ -37,7 +37,7 @@ document:
- get: QUERY
- "\n\n"
def: QUERY1
show_result: false
contribute: []


- model: ibm/granite-20b-code-instruct
Expand Down Expand Up @@ -118,7 +118,7 @@ document:
- get: QUERY1
- "\n\n"
def: PDL
show_result: false
contribute: []

- lan: python
code: |
Expand All @@ -136,5 +136,5 @@ document:
data = Program.model_validate(obj)
_, result, _, _ = process_prog(state, empty_scope, data)
def: RESULT
show_result: false
contribute: []
- "\n"
3 changes: 1 addition & 2 deletions examples/fibonacci/fib.pdl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ document:
code: |
import random
result = random.randint(1, 20)
show_result: true
- "\nNow computing fib("
- get: N
- ")\n"
Expand All @@ -20,7 +19,7 @@ document:
code: |
{{ CODE }}
result = fib({{ N }})
show_result: false
contribute: []
- 'The result is: '
- get: RESULT
- "\n\nExplain what the above code does and what the result means\n\n"
Expand Down
2 changes: 1 addition & 1 deletion examples/granite/multi_round_chat.pdl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ document:
parser: json
def: prompts
spec: {prompts: [str]}
show_result: false
contribute: []
- "{{ SYSTEM_CONTENT_CHAT }}"
- for:
prompt: "{{ prompts.prompts }}"
Expand Down
1 change: 0 additions & 1 deletion examples/gsm8k/math-base.pdl
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ document:
params:
stop_sequences: ["Question"]
include_stop_sequence: false
show_result: true
Loading

0 comments on commit 9e28ab8

Please sign in to comment.