|
14 | 14 | " " |
15 | 15 | ), |
16 | 16 | "granite": ( |
17 | | - "Question:\nComplete the following Python function:\n\n{{problem}}\n\nAnswer:\n" |
| 17 | + "<|endoftext|>Question:\nComplete the following Python function:\n\n{{problem}}\n\nAnswer:\n" |
18 | 18 | "Sure! Here is how you might implement the function:\n\n```python\n{{problem}}", |
19 | 19 | " " |
20 | 20 | ), |
21 | 21 | "llama": ( |
22 | | - "[INST] <<SYS>>\n" |
| 22 | + "<s>[INST] <<SYS>>\n" |
23 | 23 | "You are a helpful AI coding assistant.\n" |
24 | 24 | "<</SYS>>\n\n" |
25 | 25 | "Complete the following Python function:\n\n" |
|
28 | 28 | " " |
29 | 29 | ), |
30 | 30 | "llama3": ( |
31 | | - "<|start_header_id|>system<|end_header_id|>\n\n" |
| 31 | + "<|begin_of_text|><|start_header_id|>system<|end_header_id|>\n\n" |
32 | 32 | "You are a helpful AI coding assistant.<|eot_id|>" |
33 | 33 | "<|start_header_id|>user<|end_header_id|>\n\n" |
34 | 34 | "Complete the following Python function:\n\n{{problem}}<|eot_id|>" |
|
37 | 37 | " " |
38 | 38 | ), |
39 | 39 | "mistral": ( |
40 | | - "[INST] You are a helpful AI coding assistant.\n\n" |
| 40 | + "<s>[INST] You are a helpful AI coding assistant.\n\n" |
41 | 41 | "Complete the following Python function:\n\n" |
42 | 42 | "{{problem}}[/INST]" |
43 | 43 | " Sure! Here is how you might implement the function:\n\n```python\n{{problem}}", |
|
51 | 51 | " " |
52 | 52 | ), |
53 | 53 | "reka": ( |
54 | | - "human: Complete the following Python function." |
| 54 | + "<|endoftext|>human: Complete the following Python function." |
55 | 55 | " Provide your reasoning in comments, but be concise and don't second-guess." |
56 | 56 | "\n\n{{problem}}" |
57 | 57 | " <sep> assistant: ```python\n{{problem}}", |
|
76 | 76 | " " |
77 | 77 | ), |
78 | 78 | "deepseek": ( |
79 | | - "You are a helpful AI coding assistant.\n" |
| 79 | + "<|begin▁of▁sentence|>You are a helpful AI coding assistant.\n" |
80 | 80 | "<|User|>Complete the following Python function:\n\n{{problem}}" |
81 | 81 | "<|Assistant|>Sure! Here is how you might implement the function:\n\n```python\n{{problem}}", |
82 | 82 | " " |
@@ -124,7 +124,11 @@ def main(args): |
124 | 124 | for idx, (problem_id, problem) in enumerate(problems.items()): |
125 | 125 | b_problem = problem["prompt"] |
126 | 126 | f_problem = prompt_format.replace("{{problem}}", b_problem) |
127 | | - input_ids = tokenizer.encode(f_problem, encode_special_tokens = True, add_bos = True) |
| 127 | + input_ids = tokenizer.encode( |
| 128 | + f_problem, |
| 129 | + encode_special_tokens = True, |
| 130 | + add_bos = (args.prompt_format == "raw") |
| 131 | + ) |
128 | 132 | for s in range(num_samples_per_task): |
129 | 133 | job = Job( |
130 | 134 | input_ids = input_ids, |
|
0 commit comments