Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
codecritic
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ziyuan Nan
codecritic
Commits
1d45c3d1
Commit
1d45c3d1
authored
Dec 30, 2024
by
nzy
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'main' of
http://62.234.201.16/nzy/codecritic
parents
fd1582c3
527f2798
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
60 additions
and
10 deletions
+60
-10
codecritic/evaluation/apps_eval.py
+3
-5
codecritic/utils/inference.py
+0
-2
scripts/gen_dataset.sh
+19
-3
scripts/gen_dataset_32b.sh
+38
-0
No files found.
codecritic/evaluation/apps_eval.py
View file @
1d45c3d1
...
...
@@ -81,10 +81,8 @@ def evaluate_code_samples(code_samples, apps):
split
,
idx
=
task_id
.
split
(
'-'
)
args
.
append
((
apps
[
split
][
int
(
idx
)],
sample
))
cpu_num
=
multiprocessing
.
cpu_count
()
# chunksize = max(len(code_samples) // (cpu_num * 5), 1)
chunksize
=
10000
# TODO performance?
cpu_num
=
multiprocessing
.
cpu_count
()
//
2
chunksize
=
max
(
len
(
code_samples
)
//
(
cpu_num
*
10
),
1
)
results
=
process_map
(
test_generation
,
args
,
max_workers
=
cpu_num
,
chunksize
=
chunksize
)
...
...
@@ -112,7 +110,7 @@ def evaluate(code_samples, apps):
assert
len
(
set
(
x
[
"solution_id"
]
for
x
in
lst
))
==
1
,
"Mismatched solution_id"
task_id
,
solution_id
=
lst
[
0
][
"task_id"
],
lst
[
0
][
"solution_id"
]
if
all
(
x
[
"compilerr"
]
for
x
in
lst
):
is_pass
=
False
else
:
...
...
codecritic/utils/inference.py
View file @
1d45c3d1
...
...
@@ -13,7 +13,6 @@ def generate_worker(cuda_device, prompts, model_path, sampling_params):
model
=
model_path
,
seed
=
42
,
max_model_len
=
8
*
1024
,
swap_space
=
16
,
tensor_parallel_size
=
len
(
cuda_device
),
)
...
...
@@ -57,7 +56,6 @@ def score_worker(cuda_device, prompts, model_path, positive_token, negative_toke
model
=
model_path
,
seed
=
42
,
max_model_len
=
8
*
1024
,
swap_space
=
16
,
tensor_parallel_size
=
len
(
cuda_device
),
)
...
...
scripts/gen_dataset.sh
View file @
1d45c3d1
...
...
@@ -2,16 +2,32 @@ set -xe
model
=
"/lustre/S/huangdi/open_for_out/models/Qwen2.5-Coder-7B-Instruct/"
project
=
"/lustre/S/nanziyuan/projects/ccc"
modelname
=
"qwen25_coder_inst"
# APPS
CUDA_VISIBLE_DEVICES
=
0,1,2,3
\
#
CUDA_VISIBLE_DEVICES=0,1,2,3 \
python
-m
codecritic.cli.gen_dataset
\
--model
${
model
}
\
--apps
/lustre/S/nanziyuan/datasets/apps/
\
--train
"
${
project
}
/data/train/
apps_train_samples
.jsonl"
\
--test
"
${
project
}
/data/test/
apps_test_samples
.jsonl"
--train
"
${
project
}
/data/train/
${
modelname
}
-apps-train
.jsonl"
\
--test
"
${
project
}
/data/test/
${
modelname
}
-apps-test
.jsonl"
# HumanEval & MBPP
# evalplus.evaluate \
# --model ${model} \
# --n_samples 50 \
# --temperature 0.8 \
# --dataset humaneval \
# --root "${project}/data/test/${modelname}-humaneval" \
# --backend vllm
# evalplus.evaluate \
# --model ${model} \
# --n_samples 50 \
# --temperature 0.8 \
# --dataset mbpp \
# --root "${project}/data/test/${modelname}-mbpp" \
# --backend vllm
# HumanEvalPack
...
...
scripts/gen_dataset_32b.sh
0 → 100644
View file @
1d45c3d1
set
-xe
model
=
"/lustre/S/huangdi/open_for_out/models/Qwen2.5-Coder-32B-Instruct"
project
=
"/lustre/S/nanziyuan/projects/ccc"
modelname
=
"qwen25_coder_inst_32b"
tp
=
4
# APPS
# CUDA_VISIBLE_DEVICES=0,1,2,3 \
python
-m
codecritic.cli.gen_dataset
\
--model
${
model
}
\
--apps
/lustre/S/nanziyuan/datasets/apps/
\
--train
"
${
project
}
/data/train/
${
modelname
}
-apps-train.jsonl"
\
--test
"
${
project
}
/data/test/
${
modelname
}
-apps-test.jsonl"
\
--tp
${
tp
}
# HumanEval & MBPP
evalplus.evaluate
\
--model
${
model
}
\
--n_samples
50
\
--temperature
0.8
\
--dataset
humaneval
\
--root
"
${
project
}
/data/test/
${
modelname
}
-humaneval"
\
--backend
vllm
\
--tp
${
tp
}
evalplus.evaluate
\
--model
${
model
}
\
--n_samples
50
\
--temperature
0.8
\
--dataset
mbpp
\
--root
"
${
project
}
/data/test/
${
modelname
}
-mbpp"
\
--backend
vllm
\
--tp
${
tp
}
# HumanEvalPack
# BigCodeBench
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment