Views
No views yet

1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3model_name = "TIGER-Lab/AceCoder-Qwen2.5-Coder-7B-Ins-V1.1"
4
5model = AutoModelForCausalLM.from_pretrained(
6 model_name,
7 torch_dtype="auto",
8 device_map="auto"
9)
10tokenizer = AutoTokenizer.from_pretrained(model_name)
11
12prompt = "Give me a short introduction to large language model."
13messages = [
14 {"role": "system", "content": "You are Qwen, created by Alibaba Cloud. You are a helpful assistant."},
15 {"role": "user", "content": prompt}
16]
17text = tokenizer.apply_chat_template(
18 messages,
19 tokenize=False,
20 add_generation_prompt=True
21)
22model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
23
24generated_ids = model.generate(
25 **model_inputs,
26 max_new_tokens=512
27)
28generated_ids = [
29 output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
30]
31
32response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]| Model Name | LiveCodeBench-v4: (2023.5-2024.9) | HumanEval | HumanEval+ | MBPP | MBPP+ | BigCodeBench-Complete Full | BigCodeBench-Complete Hard | BigCodeBench-Instruct Full | BigCodeBench-Instruct Hard |
|---|---|---|---|---|---|---|---|---|---|
| GPT-4o (0806) | 43.6 | 92.7 | 87.2 | 87.6 | 72.2 | 58.9 | 36.5 | 48.0 | 25.0 |
| DeepCoder-14B-Preview | - | - | 92.6 | - | - | 49.6 | 22.3 | 38.2 | 18.2 |
| Qwen2.5-Coder-7B-Base (Backbone Model) | 28.7 | 61.6 | 53.0 | 76.9 | 62.9 | 45.8 | 16.2 | 40.2 | 14.2 |
| Qwen2.5-7B-Instruct | 29.0 | 81.7 | 73.2 | 79.4 | 67.7 | 45.6 | 16.9 | 38.4 | 14.2 |
| Qwen2.5-Coder-7B-Instruct | 34.2 | 91.5 | 86.0 | 82.8 | 71.4 | 49.5 | 19.6 | 41.8 | 20.3 |
| AceCoder-V1.1-7B | 35.7 | 88.4 | 83.5 | 84.9 | 73.0 | 53.9 | 27.0 | 41.8 | 23.0 |
1@article{AceCoder,
2 title={AceCoder: Acing Coder RL via Automated Test-Case Synthesis},
3 author={Zeng, Huaye and Jiang, Dongfu and Wang, Haozhe and Nie, Ping and Chen, Xiaotong and Chen, Wenhu},
4 journal={ArXiv},
5 year={2025},
6 volume={abs/2207.01780}
7}