-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproblem_prepare.py
More file actions
53 lines (43 loc) · 1.22 KB
/
problem_prepare.py
File metadata and controls
53 lines (43 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
from pathlib import Path
def main(
model_name: str,
api_key: str,
target_file_path: Path,
max_iter: int,
) -> None:
from src.application.pipeline import ConjecturerPipeline
with target_file_path.open("r") as f:
contexts = [f.read()]
ConjecturerPipeline.run(model_name, api_key, contexts, max_iter)
if __name__ == "__main__":
import argparse
import os
from dotenv import load_dotenv
load_dotenv()
parser = argparse.ArgumentParser(description="Conjecturer CLI")
parser.add_argument(
"--model_name",
type=str,
default="o3",
help="The name of the model to use for generation.",
)
parser.add_argument(
"--api_key",
type=str,
default=os.getenv("OPENAI_API_KEY"),
help="The API key for the model.",
)
parser.add_argument(
"--target",
type=str,
default="./InterClosureExercise.lean",
help="The path to the target file.",
)
parser.add_argument(
"--max_iter",
type=int,
default=15,
help="The number of iterations to run.",
)
args = parser.parse_args()
main(args.model_name, args.api_key, Path(args.target), args.max_iter)