Skip to content

Commit 020653b

Browse files
committed
Lint
Signed-off-by: Claudio Spiess <[email protected]>
1 parent e1979ae commit 020653b

File tree

4 files changed

+11
-113
lines changed

4 files changed

+11
-113
lines changed

examples/optimizer/fever.pdl

Lines changed: 0 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -8,74 +8,7 @@ defs:
88
import: ../../contrib/prompt_library/ReWoo
99
tools:
1010
import: ../../contrib/prompt_library/tools
11-
search_tools_react:
12-
data:
13-
- name: Search ReAct
14-
display_name: Search
15-
pdl_function: Search
16-
description: Search Wikipedia for a summary
17-
parameters:
18-
- name: topic
19-
type: string
20-
description: The topic of interest
21-
examples:
22-
[]
23-
# - - task: |
24-
# On June 2017, the following claim was made: The elevation range for the area that the eastern sector of the Colorado orogeny extends into is 1,800 to 7,000 ft.
25-
# Q: Was this claim true or false?
26-
# - thought: "I need to search Colorado orogeny, find the area that the eastern sector of the Colorado ..."
27-
# - action: "Search[Colorado orogeny]"
28-
# - observation: "[Document]\nThe Colorado orogeny was an episode of mountain building (an orogeny) ...\n[End]"
29-
# - thought: "High Plains rise in elevation from around 1,800 to 7,000 ft, so the answer is 1,800 to 7,000 ft."
30-
# - thought: "The claim is True."
31-
# - action: "Finish[True]"
32-
# - - task: |
33-
# On June 2017, the following claim was made: Professions Nicholas Ray and Elia Kazan have in common are director, screenwriter, and actor.
34-
# Q: Was this claim true or false?
35-
# - thought: "I need to search Nicholas Ray and Elia Kazan, find their professions, then find the profession they have in common."
36-
# - action: "Search[Nicholas Ray]"
37-
# - observation: "[Document]\nNicholas Ray (born Raymond Nicholas Kienzle Jr., August 7, 1911 - June 16, 1979) was an American film director, screenwriter, and actor best known for the 1955 film Rebel Without a Cause.\n[End]"
38-
# - thought: "Professions of Nicholas Ray are director, screenwriter, and actor. I need to search Elia Kazan next and find his professions."
39-
# - action: "Search[Elia Kazan]"
40-
# - observation: "[Document]\nElia Kazan was an American film and theatre director, producer, screenwriter and actor.\n[End]"
41-
# - thought: "Professions of Elia Kazan are director, producer, screenwriter, and actor. So profession Nicholas Ray and Elia Kazan have in common is director, screenwriter, and actor."
42-
# - thought: "The claim is True."
43-
# - action: "Finish[True]"
44-
search_tools_rewoo:
45-
data:
46-
- name: Search ReWOO
47-
display_name: Search
48-
pdl_function: Search
49-
description: Search Wikipedia for a summary
50-
parameters:
51-
- name: topic
52-
type: string
53-
description: The topic of interest
54-
examples:
55-
[]
56-
# - - task: |
57-
# On June 2017, the following claim was made: The elevation range for the area that the eastern sector of the Colorado orogeny extends into is 1,800 to 7,000 ft.
58-
# Q: Was this claim true or false?
59-
# - thought: "I need to search Colorado orogeny, find the area that the eastern sector of the Colorado ..."
60-
# - action: "Search[Colorado orogeny]"
61-
# - observation: "[Document]\nThe Colorado orogeny was an episode of mountain building (an orogeny) ...\n[End]"
62-
# - - task: |
63-
# On June 2017, the following claim was made: Professions Nicholas Ray and Elia Kazan have in common are director, screenwriter, and actor.
64-
# Q: Was this claim true or false?
65-
# - thought: "Search Nicholas Ray and Elia Kazan, find their professions, then find the profession they have in common."
66-
# - action: "Search[Nicholas Ray]"
67-
# - observation: "[Document]\nNicholas Ray (born Raymond Nicholas Kienzle Jr., August 7, 1911 - June 16, 1979) was an American film director, screenwriter, and actor best known for the 1955 film Rebel Without a Cause.\n[End]"
68-
# - thought: "Search Elia Kazan."
69-
# - action: "Search[Elia Kazan]"
70-
# - observation: "[Document]\nElia Kazan was an American film and theatre director, producer, screenwriter and actor.\n[End]"
71-
# model: "meta-llama/llama-3-70b-instruct"
72-
# prompt_pattern: "react"
73-
# claim: "Fox 2000 Pictures released the film Soul Food."
74-
# task: >
75-
# Task: Determine if there is Observation that SUPPORTS or REFUTES
76-
# a Claim, or if there is NOT ENOUGH INFORMATION.
7711

78-
# Claim: {{ claim }}
7912
search_tools:
8013
data:
8114
- name: Search

examples/optimizer/gsm8k.pdl

Lines changed: 9 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ text:
1313
- if: "${ prompt_pattern == 'cot' }"
1414
then:
1515
text:
16-
- "Answer the questions to the best of your abilities.\n\n"
17-
- call: ${ cot.chain_of_thought }
18-
def: ANSWER
19-
contribute: []
20-
args:
21-
examples: "${ demonstrations }"
22-
question: "${ question|trim }"
23-
model: "${ model }"
24-
- "\nThe answer is ${ ANSWER.answer|trim }"
16+
- "Answer the questions to the best of your abilities.\n\n"
17+
- call: ${ cot.chain_of_thought }
18+
def: ANSWER
19+
contribute: []
20+
args:
21+
examples: "${ demonstrations }"
22+
question: "${ question|trim }"
23+
model: "${ model }"
24+
- "\nThe answer is ${ ANSWER.answer|trim }"
2525

2626
# ReAct
2727
- if: ${ prompt_pattern == 'react' }
@@ -47,34 +47,3 @@ text:
4747
tools: ${ tools.tools }
4848
trajectories: ${ demonstrations }
4949
show_plans: false
50-
51-
# # ReAct
52-
# - if: "${ prompt_pattern == 'react' }"
53-
# then:
54-
# text:
55-
# - include: ../../tools.pdl
56-
# - include: ../../ReAct.pdl
57-
# - call: ${ react }
58-
# def: ANSWER
59-
# args:
60-
# task: "Question: ${ question|trim }"
61-
# model: "${ model }"
62-
# tools: ${ tools }
63-
# trajectories: ${ demonstrations }
64-
# - "\nThe answer is ${ ANSWER.answer|trim }"
65-
66-
# # ReWOO
67-
# - if: "${ prompt_pattern == 'rewoo' }"
68-
# then:
69-
# text:
70-
# - include: ../../tools.pdl
71-
# - include: ../../ReWoo.pdl
72-
# - call: ${ rewoo }
73-
# def: ANSWER
74-
# args:
75-
# task: "Task: ${ question }"
76-
# model: "${ model }"
77-
# tools: ${ tools }
78-
# trajectories: ${ demonstrations }
79-
# show_plans: false
80-
# - "\nThe answer is ${ ANSWER.answer|trim }"

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ dependencies = [
1818
"ipython>=8,<10",
1919
"json-repair~=0.35",
2020
"granite-io>=0.2,<0.4",
21+
"multiprocess>=0.70",
2122
]
2223
authors = [
2324
{ name="Mandana Vaziri", email="[email protected]" },
@@ -62,7 +63,6 @@ optimizer = [
6263
"rich>=14.0.0",
6364
"evalplus>=0.3.1",
6465
"duration_parser>=1.0.1",
65-
"multiprocess>=0.70",
6666
]
6767
all = [ "prompt-declaration-language[dev,examples,docs,optimizer]" ]
6868

src/pdl/optimize/optimizer_evaluator.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,7 @@ def run( # type: ignore # noqa: C901
7373
console.log("RETRYING! ", tries)
7474
try:
7575
tries += 1
76-
# state = InterpreterState(
77-
# yield_result=self.yield_output,
78-
# yield_background=self.yield_output,
79-
# cwd=self.cwd,
80-
# )
76+
8177
config = InterpreterConfig(
8278
yield_result=self.yield_output,
8379
yield_background=self.yield_output,

0 commit comments

Comments
 (0)