Skip to content

Commit 7efd58b

Browse files
authored
Switch to granite-io version 0.2 (#818)
1 parent 875ead4 commit 7efd58b

File tree

6 files changed

+110
-74
lines changed

6 files changed

+110
-74
lines changed

examples/granite-io/granite_io_hallucinations.pdl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,5 @@ text:
4747
controls:
4848
hallucinations: true
4949
citations: true
50+
modelResponse: outputs
51+
- ${ outputs }
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
text:
22
- "Hello!\n"
33
- model: "granite3.2:2b"
4-
backend: openai
4+
backend: openai

examples/granite-io/granite_io_thinking.pdl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ text:
88
thinking: true
99
modelResponse: outputs
1010
- |
11+
1112
>> Thoughts:
12-
${ outputs.reasoning_content }
13+
${ outputs.results[0].next_message.reasoning_content }

examples/notebooks/granite_io_demo.ipynb

Lines changed: 96 additions & 67 deletions
Large diffs are not rendered by default.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ dependencies = [
1717
"termcolor~=2.0",
1818
"ipython>=8,<10",
1919
"json-repair~=0.35",
20-
"granite-io~=0.1",
20+
"granite-io~=0.2",
2121
]
2222
authors = [
2323
{ name="Mandana Vaziri", email="[email protected]" },

src/pdl/pdl_interpreter.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1289,10 +1289,14 @@ def process_call_model(
12891289
)
12901290
case GraniteioModelBlock():
12911291
_, concrete_block = process_expr_of(concrete_block, "backend", scope, loc)
1292-
_, concrete_block = process_expr_of(concrete_block, "processor", scope, loc)
1293-
_, concrete_block = process_expr_of(
1294-
concrete_block, "parameters", scope, loc
1295-
)
1292+
if concrete_block.processor is not None:
1293+
_, concrete_block = process_expr_of(
1294+
concrete_block, "processor", scope, loc
1295+
)
1296+
if concrete_block.parameters is not None:
1297+
_, concrete_block = process_expr_of(
1298+
concrete_block, "parameters", scope, loc
1299+
)
12961300
case _:
12971301
assert False
12981302
# evaluate input

0 commit comments

Comments
 (0)