doc: Improve error message
This commit is contained in:
parent
b440363105
commit
20f3011eb4
|
@ -0,0 +1 @@
|
||||||
|
/output*
|
|
@ -1,11 +1,14 @@
|
||||||
# MiniF2F
|
# MiniF2F
|
||||||
|
|
||||||
This is an experiment on running a LLM prover on miniF2F data. Run with
|
This is an experiment on running a LLM prover on miniF2F data. Build the project
|
||||||
|
`MiniF2F` with `lake build`, and run with
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
python3 experiments/minif2f/main.py [--dry-run]
|
python3 experiments/minif2f/main.py [--dry-run] [--use-llm]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Read the help message carefully.
|
||||||
|
|
||||||
## Developing
|
## Developing
|
||||||
|
|
||||||
Run unit tests with
|
Run unit tests with
|
||||||
|
|
|
@ -72,9 +72,10 @@ def run_eval(args):
|
||||||
if file_name.is_file():
|
if file_name.is_file():
|
||||||
print(f"Skipping {datum['id']}")
|
print(f"Skipping {datum['id']}")
|
||||||
continue
|
continue
|
||||||
server = Server(imports=["MiniF2F"], project_path=project_path, lean_path=lean_path, core_options=["maxHeartbeats=0"])
|
server = Server(imports=["MiniF2F"], project_path=project_path, lean_path=lean_path)
|
||||||
agent = LLMAgent(server, use_hammer=args.use_hammer, use_llm=args.use_llm)
|
agent = LLMAgent(server, use_hammer=args.use_hammer, use_llm=args.use_llm)
|
||||||
result = try_test_data(server, agent, datum, max_steps=args.max_steps, max_trials_per_goal=args.max_trials_per_goal)
|
result = try_test_data(server, agent, datum, max_steps=args.max_steps, max_trials_per_goal=args.max_trials_per_goal)
|
||||||
|
#server.gc()
|
||||||
if result is None:
|
if result is None:
|
||||||
with open(placeholder_file_name, 'w') as f:
|
with open(placeholder_file_name, 'w') as f:
|
||||||
json.dump({ 'id': datum['id'] }, f)
|
json.dump({ 'id': datum['id'] }, f)
|
||||||
|
|
|
@ -28,8 +28,8 @@ class Server:
|
||||||
# Options for executing the REPL.
|
# Options for executing the REPL.
|
||||||
# Set `{ "automaticMode" : False }` to handle resumption by yourself.
|
# Set `{ "automaticMode" : False }` to handle resumption by yourself.
|
||||||
options={},
|
options={},
|
||||||
core_options=[],
|
core_options=["maxHeartbeats=0"],
|
||||||
timeout=20,
|
timeout=60,
|
||||||
maxread=1000000):
|
maxread=1000000):
|
||||||
"""
|
"""
|
||||||
timeout: Amount of time to wait for execution
|
timeout: Amount of time to wait for execution
|
||||||
|
@ -86,7 +86,10 @@ class Server:
|
||||||
self.proc.sendline(f"{cmd} {s}")
|
self.proc.sendline(f"{cmd} {s}")
|
||||||
try:
|
try:
|
||||||
line = self.proc.readline()
|
line = self.proc.readline()
|
||||||
|
try:
|
||||||
return json.loads(line)
|
return json.loads(line)
|
||||||
|
except Exception as e:
|
||||||
|
raise ServerError(f"Cannot decode: {line}") from e
|
||||||
except pexpect.exceptions.TIMEOUT as exc:
|
except pexpect.exceptions.TIMEOUT as exc:
|
||||||
raise exc
|
raise exc
|
||||||
|
|
||||||
|
@ -96,9 +99,12 @@ class Server:
|
||||||
|
|
||||||
Must be called periodically.
|
Must be called periodically.
|
||||||
"""
|
"""
|
||||||
if self.to_remove_goal_states:
|
if not self.to_remove_goal_states:
|
||||||
self.run('goal.delete', {'stateIds': self.to_remove_goal_states})
|
return
|
||||||
|
result = self.run('goal.delete', {'stateIds': self.to_remove_goal_states})
|
||||||
self.to_remove_goal_states.clear()
|
self.to_remove_goal_states.clear()
|
||||||
|
if "error" in result:
|
||||||
|
raise ServerError(result["desc"])
|
||||||
|
|
||||||
def expr_type(self, expr: Expr) -> Expr:
|
def expr_type(self, expr: Expr) -> Expr:
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue