Skip to content

Commit e268d76

Browse files
committed
初步构建完成
1 parent afd1267 commit e268d76

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+667
-34
lines changed

LeanEval/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from prompt import SimplePromptBuilder
2+
from prompt import FewShotPromptBuilder
3+
from prompt import get_builder

LeanEval/data/json/data_2.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[
2+
{
3+
"id": "3d0b29e2-6197-422e-8a1b-97ab7b9d5c83",
4+
"imports": ["Mathlib.Data.Set.Basic"],
5+
"statement": "theorem subset_refl {α : Type*} (s : Set α) : s ⊆ s",
6+
"extra_ctx": "",
7+
"difficulty": 1
8+
}
9+
]

LeanEval/data/jsonl/data_1.jsonl

Lines changed: 80 additions & 0 deletions
Large diffs are not rendered by default.

LeanEval/datasets/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from .base import BaseDataset
2+
from .csv_dataset import CsvDataset
3+
from .json_dataset import JsonDataset
4+
from .json_dataset import JsonlDataset
5+
from .yaml_dataset import YamlDataset
6+
from .schema import LeanItem
400 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
233 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

LeanEval/datasets/csv_dataset.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# csv_dataset.py
21
from __future__ import annotations
32

43
import csv

LeanEval/datasets/schema.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,17 @@ class LeanItem(BaseModel, frozen=True, extra="allow"):
1313
@property
1414
def prompt_ready_stmt(self) -> str:
1515
"""预拼接好 imports + statement,方便 PromptBuilder 直接用"""
16+
parts = []
1617
if self.imports:
1718
imports_txt = "\n".join([f"import {i}" for i in self.imports])
18-
else:
19-
imports_txt = ""
20-
return f"{imports_txt}\n\n{self.statement}"
19+
parts.append(imports_txt)
20+
if self.extra_ctx:
21+
parts.append(self.extra_ctx)
22+
parts.append(self.statement)
23+
return "\n\n".join(parts)
24+
25+
@property
26+
def difficulty(self) -> int:
27+
"""返回这道题的难度,用于评分"""
28+
return self.difficulty
29+

0 commit comments

Comments
 (0)