Skip to content

Commit e66e0de

Browse files
authored
Update examples to ollama_chat (#691)
* Change examples to use ollama_chat Signed-off-by: Jing Chen <[email protected]> * Update error.pdl Signed-off-by: Jing Chen <[email protected]> * More updates Signed-off-by: Jing Chen <[email protected]> * Use granite3.2:2b Signed-off-by: Jing Chen <[email protected]> * Update pdl-live demo traces Signed-off-by: Jing Chen <[email protected]> * Update results Signed-off-by: Jing Chen <[email protected]> * Update res Signed-off-by: Jing Chen <[email protected]> --------- Signed-off-by: Jing Chen <[email protected]>
1 parent cadd935 commit e66e0de

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+138
-146
lines changed

.github/workflows/run-examples.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,14 @@ jobs:
3333
- name: Pull models in examples/
3434
shell: bash
3535
run: |
36-
ollama pull granite-code:8b
37-
ollama pull granite3-dense:8b
38-
ollama pull granite3.1-dense
3936
ollama pull granite3.2:2b
40-
ollama pull granite3.2
41-
ollama pull granite3.2:8b
4237
ollama pull mxbai-embed-large
4338
ollama list
4439
4540
- name: Check that all required models are available
4641
shell: bash
4742
run: |
48-
models=("granite-code" "granite3-dense" "granite3.1-dense" "mxbai-embed-large" "granite3.2:2b" "granite3.2" "granite3.2:8b")
43+
models=("mxbai-embed-large" "granite3.2:2b")
4944
missing=0
5045
for model in "${models[@]}"; do
5146
if ! ollama list | awk 'NR>1 {print $1}' | grep -q "$model"; then

examples/callback/repair_prompt.pdl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ lastOf:
99
Please repair the code!
1010

1111
- def: raw_output
12-
model: ollama/granite-code:8b
12+
model: ollama_chat/granite3.2:2b
1313
parameters:
1414
#stop_sequences: "\n\n"
1515
temperature: 0

examples/chatbot/chatbot.pdl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
description: chatbot
1+
description: Chatbot
22
text:
33
# Allow the user to type any question, implicitly adding the question to the context.
44
- read:
55
message: "What is your query?\n"
66
- repeat:
77
text:
88
# Send context to Granite model hosted at replicate.com
9-
- model: ollama_chat/granite3.2:8b
9+
- model: ollama_chat/granite3.2:2b
1010
# Allow the user to type 'yes', 'no', or anything else, storing
1111
# the input into a variable named `eval`. The input is also implicitly
1212
# added to the context.

examples/code/code-eval.pdl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ text:
1212
- "\n${ CODE.source_code }\n"
1313
# Use ollama to invoke a Granite model with a prompt. Output AND
1414
# set the variable `EXPLANATION` to the output.
15-
- model: ollama/granite-code:8b
15+
- model: ollama_chat/granite3.2:2b
1616
def: EXPLANATION
1717
input: |
1818
Here is some info about the location of the function in the repo.

examples/code/code-json.pdl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ defs:
66
TRUTH:
77
read: ./ground_truth.txt
88
text:
9-
- model: ollama/granite-code:8b
9+
- model: ollama_chat/granite3.2:2b
1010
def: EXPLANATION
1111
contribute: []
1212
input:

examples/code/code.pdl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ text:
88
# Output the `source_code:` of the YAML to the console
99
- "\n${ CODE.source_code }\n"
1010
# Use ollama to invoke a Granite model with a prompt
11-
- model: ollama/granite-code:8b
11+
- model: ollama_chat/granite3.2:2b
1212
input: |
1313
Here is some info about the location of the function in the repo.
1414
repo:

examples/demo/3-weather.pdl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ description: Using a weather API and LLM to make a small weather app
22
text:
33
- def: QUERY
44
text: "What is the weather in Madrid?\n"
5-
- model: ollama/granite-code:8b
5+
- model: ollama_chat/granite3.2:2b
66
input: |
77
Extract the location from the question.
88
Question: What is the weather in London?
@@ -25,7 +25,7 @@ text:
2525
def: WEATHER
2626
parser: json
2727
contribute: []
28-
- model: ollama/granite-code:8b
28+
- model: ollama_chat/granite3.2:2b
2929
input: |
3030
Explain the weather from the following JSON:
3131
${ WEATHER }

examples/demo/4-translator.pdl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
description: PDL program
22
text:
33
- "What is APR?\n"
4-
- model: ollama/granite-code:8b
4+
- model: ollama_chat/granite3.2:2b
55
- repeat:
66
text:
77
- read:
@@ -11,5 +11,5 @@ text:
1111
then:
1212
text:
1313
- "\n\nTranslate the above to ${ language }\n"
14-
- model: ollama/granite-code:8b
14+
- model: ollama_chat/granite3.2:2b
1515
until: ${ language == 'stop' }

examples/fibonacci/fib.pdl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ text:
66
# Use IBM Granite to author a program that computes the Nth Fibonacci number,
77
# storing the generated program into the variable `CODE`.
88
- def: CODE
9-
model: ollama/granite-code:8b
9+
model: ollama_chat/granite3.2:2b
1010
input: "Write a Python function to compute the Fibonacci sequence. Do not include a doc string.\n\n"
1111
parameters:
1212
# Request no randomness when generating code
@@ -42,4 +42,4 @@ text:
4242

4343
# Invoke the LLM again to explain the PDL context
4444
- "\n\nExplain what the above code does and what the result means\n\n"
45-
- model: ollama/granite-code:8b
45+
- model: ollama_chat/granite3.2:2b

examples/granite/multi_round_chat.pdl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ text:
1818

1919
${ prompt }
2020
# Use replicate.com to run the Granite model on the context, outputting the result
21-
- model: ollama/granite3.1-dense
21+
- model: ollama_chat/granite3.2:2b
2222
parameters:
2323
# Use no LLM model creativity (0 is the default)
2424
temperature: 0

0 commit comments

Comments
 (0)