10000 fixes formatting · commit-0/commit0@06daf7b · GitHub
[go: up one dir, main page]

Skip to content

Commit 06daf7b

Browse files
committed
fixes formatting
1 parent bc51469 commit 06daf7b

File tree

4 files changed

+336
-660
lines changed

4 files changed

+336
-660
lines changed

commit0/harness/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ def extract_code_blocks(text: str) -> List[str]:
239239
from the text.
240240
241241
"""
242-
pattern = r"```python\n(.*?)```"
242+
pattern = r'(?s)```(?:python|py)?(.*?)```'
243243
matches = re.finditer(pattern, text, re.DOTALL)
244244
return [match.group(1).strip() for match in matches]
245245

examples/star/inference.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import List
1+
from typing import Dict, List
22
from datasets import Dataset
33
from vllm import LLM, SamplingParams
44
from examples.star.utils import generate_prompt, cleanup
@@ -28,14 +28,14 @@ def generate_predictions(
2828
sampling_params = SamplingParams(n=n, temperature=temperature, max_tokens=512)
2929
llm = LLM(model=model_name)
3030

31-
prompts: List[str] = []
31+
prompts: List[List[Dict]] = []
3232
for example in dataset:
3333
prompt = example["prompt"]
3434
test = example["test"]
3535
prompt = generate_prompt(prompt, test)
36-
prompts.append(prompt)
36+
prompts.append([{"role": "user", "content": prompt}])
3737

38-
outputs = llm.generate(prompts, sampling_params)
38+
outputs = llm.chat(prompts, sampling_params)
3939

4040
results: List[List[str]] = []
4141
for output in outputs:

pyproject.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,15 @@ packages = ["commit0", "agent"]
3636
agent = [
3737
"import-deps>=0.3.0",
3838
"PyMuPDF>=1.24.5",
39-
"aider-chat",
39+
#"aider-chat>=0.69.1",
4040
]
4141
example = [
42-
"vllm",
43-
"transformers",
42+
"vllm==0.6.5",
43+
"transformers>=4.47.1",
4444
"setuptools",
4545
"accelerate",
4646
"wandb>=0.19.0",
47+
"openai>=1.58.1",
4748
]
4849

4950
[project.urls]

0 commit comments

Comments
 (0)
0