Skip to content

Commit f763d5f

Browse files
committed
Fixed small bug in using seeds in run_gpt3_experiments.py
1 parent 84f89b7 commit f763d5f

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

solvers/gpt3/run_gpt3_experiments.py

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,8 @@
22
This script runs the GPT_3 experiments and prints the results to stdout.
33
It uses cacheing mechanisms so that if run twice with the same parameters, it will give exactly the same
44
results and will not query the GPT3 API again and will not judge the resulting solutions again. Hence, the first
5-
time you run it, it will be slow, but you can subsequently run it again and it will be fast.
6-
7-
It was run with sys.version = '3.6.9 (default, Jan 26 2021, 15:33:00) \n[GCC 8.4.0]'
8-
python (3.6.9)
9-
astor (0.8.1)
10-
openai (0.6.3)
11-
transformers (2.11.0)
12-
Pebble (4.6.1)
5+
time you run it, it will be slow, but you can subsequently run it again and it will be fast. It will run the
6+
experiment three times, with different seeds to get different results.
137
148
"""
159

@@ -120,11 +114,11 @@ def f5(n: int):
120114

121115

122116
def run(seed=0):
123-
sols = [lm_solve.prompt_experiment(**PARAMS, prefix=""),
124-
lm_solve.prompt_experiment(**PARAMS, prefix=PREFIX),
125-
lm_solve.prompt_experiment(**PARAMS, prefix=PREFIX_DOCSTR, add_docstring=True)]
117+
sols = [lm_solve.prompt_experiment(**PARAMS, prefix="", seed=seed),
118+
lm_solve.prompt_experiment(**PARAMS, prefix=PREFIX, seed=seed),
119+
lm_solve.prompt_experiment(**PARAMS, prefix=PREFIX_DOCSTR, add_docstring=True, seed=seed)]
126120
problems_solved = [sorted([i for i, (f, gs) in enumerate(s) if gs]) for s in sols]
127-
bootstrap = lm_solve.bootstrap(**BOOTSTRAP_PARAMS)
121+
bootstrap = lm_solve.bootstrap(**BOOTSTRAP_PARAMS, seed=seed)
128122
print(f"run={seed} ALL DONE!\n\n")
129123
print(f"run={seed} RESULTS " + "=" * 50)
130124
print()

0 commit comments

Comments
 (0)