Skip to content

Commit c418843

Browse files
committed
Make max epochs configurable
1 parent fab9793 commit c418843

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

main.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,10 @@ def main(
148148
"./build", "--sandbox-path", "-s",
149149
help="You may optionally specify a location for the sandbox in which the code generator operates."
150150
"Default: ./build"
151+
),
152+
max_epochs: int = typer.Option(
153+
5, "--max-epochs", "-n", help="The maximum number of times to let the code generator try"
154+
"before giving up."
151155
)
152156
) -> None:
153157
set_global(
@@ -161,7 +165,7 @@ def main(
161165
sandbox = CodeGenSandbox(project_dir, class_skeleton_path, test_path, sandbox_path)
162166
sandbox.init_sandbox()
163167
tr: GenericTestRunner = SubProcessTestRunner(sandbox)
164-
chat(sandbox, tr)
168+
chat(sandbox, tr, max_epochs=max_epochs)
165169

166170

167171
if __name__ == "__main__":

0 commit comments

Comments
 (0)