Skip to content

Commit ed3c4fa

Browse files
committed
Update doc
Signed-off-by: Claudio Spiess <[email protected]>
1 parent e4b5ef2 commit ed3c4fa

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

docs/autopdl.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,12 @@ Let's go through an example for `GSM8K`. Our PDL program uses different prompt p
6464
--8<-- "./examples/optimizer/gsm8k.pdl"
6565
```
6666

67-
We write a configuration file for the optimizer, and save it as `gsm8k_optimizer_config.yml`. See `src/pdl/optimize/config_parser.py` for all fields.
67+
We write a configuration file for the optimizer, and save it as `gsm8k_optimizer_config.yml`. See `src/pdl/optimize/config_parser.py` for all fields. Please note that this example uses the `watsonx` inference service, so an API key is required, although you can also use a local model or any other inference service.
6868

6969
``` { .yaml .copy .annotate title="examples/optimizer/gsm8k_optimizer_config.yml" linenums="1" }
7070
--8<-- "./examples/optimizer/gsm8k_optimizer_config.yml"
7171
```
7272

73-
7473
```python title="examples/optimizer/gsm8k_evaluator.py" linenums="1"
7574
--8<-- "./examples/optimizer/gsm8k_evaluator.py"
7675
```
@@ -173,4 +172,17 @@ This will report details about the optimization process, such as the number of c
173172
0% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0/1,200 [ 0:00:01 < -:--:-- , ? it/s ]
174173
```
175174

175+
Note that it is not unusual to observe PDL exceptions during the optimization process.
176+
177+
```text
178+
[15:44:14] Type errors during spec checking:
179+
../../contrib/prompt_library/ReAct.pdl:0 - should be an object
180+
../../contrib/prompt_library/ReAct.pdl:0 - Type errors during spec checking:
181+
../../contrib/prompt_library/ReAct.pdl:0 - should be an object
182+
Retrying: False
183+
Runtime FAILED and took seconds: 10.21
184+
```
185+
186+
Such exceptions, here for example in `ReAct.pdl`, are caused by the _typed_ model call in `ReAct.pdl:98`. If the model output does not result in a parsable JSON that matches the expected type `{ name: string, arguments: object }`, the PDL interpreter raises an exception.
187+
176188
Once the process is complete, a file `optimized_gsm8k.pdl` is written in same directory as the source PDL file. This file contains the optimal configuration and is directly executable by the standard PDL interpreter. A log of the optimization process is written to `experiments/` by default.

0 commit comments

Comments
 (0)