Skip to content

Commit 81a0a7d

Browse files
authored
Merge pull request #35 from gakada/humaneval
humaneval.py: fix top_k type, remove rep_p, add qwen3
2 parents ae04741 + beb7bcd commit 81a0a7d

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

eval/humaneval.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,15 @@
6666
"Sure! Here is how you might implement the function:\n\n```python\n{{problem}}",
6767
" "
6868
),
69+
"qwen3": (
70+
"<|im_start|>system\n"
71+
"You are a helpful AI coding assistant.<|im_end|>\n"
72+
"<|im_start|>user\n"
73+
"Complete the following Python function:\n\n{{problem}}<|im_end|>\n"
74+
"<|im_start|>assistant\n"
75+
"<think>\n\n</think>\n\nSure! Here is how you might implement the function:\n\n```python\n{{problem}}",
76+
" "
77+
),
6978
"deepseek": (
7079
"You are a helpful AI coding assistant.\n"
7180
"<|User|>Complete the following Python function:\n\n{{problem}}"
@@ -99,7 +108,6 @@ def main(args):
99108
tokenizer = tokenizer
100109
)
101110
sampler = ComboSampler(
102-
rep_p = args.rep_p,
103111
temperature = args.temperature,
104112
min_p = args.min_p,
105113
top_k = args.top_k,
@@ -189,10 +197,9 @@ def main(args):
189197
parser.add_argument("-e", "--eval", action = "store_true", help = "Run evaluation script on output file after sampling")
190198
parser.add_argument("-temp", "--temperature", type = float, help = "Sampling temperature (0 for greedy), default: 0.6", default = 0.6)
191199
parser.add_argument("-minp", "--min_p", type = float, help = "Min-p sampling, default: 0.0 (disabled)", default = 0.0)
192-
parser.add_argument("-topk", "--top_k", type = float, help = "Top-k sampling, default: 0.0 (disabled)", default = 0.0)
200+
parser.add_argument("-topk", "--top_k", type = int, help = "Top-k sampling, default: 0 (disabled)", default = 0)
193201
parser.add_argument("-topp", "--top_p", type = float, help = "Top-p sampling, default: 0.6", default = 0.6)
194202
parser.add_argument("-templast", "--temp_last", action = "store_true", help = "Use temperature last")
195-
parser.add_argument("-repp", "--rep_p", type = float, help = "Repetition penalty, default: 1.0 (disabled)", default = 1.0)
196203
parser.add_argument("--max_tokens", type = int, default = 768, help = "Max number of tokens for each completion")
197204
_args = parser.parse_args()
198205
main(_args)

0 commit comments

Comments
 (0)