File tree Expand file tree Collapse file tree 4 files changed +336
-660
lines changed Expand file tree Collapse file tree 4 files changed +336
-660
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 1- from typing import List
1+ from typing import Dict , List
22from datasets import Dataset
33from vllm import LLM , SamplingParams
44from 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 :
Original file line number Diff line number Diff line change @@ -36,14 +36,15 @@ packages = ["commit0", "agent"]
3636agent = [
3737 " import-deps>=0.3.0" ,
3838 " PyMuPDF>=1.24.5" ,
39- " aider-chat" ,
39+ # "aider-chat>=0.69.1 ",
4040]
4141example = [
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 ]
You can’t perform that action at this time.
0 commit comments