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
ecf95207
Commit
ecf95207
authored
Oct 25, 2024
by
nzy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
step1: code refactoring: split a large config file to multiple small pieces
parent
89c84aef
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
53 additions
and
34 deletions
+53
-34
step1_config.toml
+20
-0
step1_evaluate_code.py
+0
-9
step1_run.py
+33
-0
step1_sample_apps.py
+0
-14
step1_sort_split_dataset.py
+0
-11
No files found.
step1_config.toml
0 → 100644
View file @
ecf95207
model
=
"/path/to/model"
apps
=
"/path/to/apps_dataset"
[sample]
sample_prompt_path
=
"path"
sample_result_path
=
"path"
[sample.sampling_params]
n
=
0
temperature
=
0.6
max_new_tokens
=
2048
[evaluate]
evaluate_result_path
=
""
[dataset]
train_path
=
""
test_path
=
""
minimal_test_path
=
""
\ No newline at end of file
step1_evaluate_code.py
View file @
ecf95207
...
@@ -147,12 +147,3 @@ def evaluate(code_sample_path, dataset_path, output_path):
...
@@ -147,12 +147,3 @@ def evaluate(code_sample_path, dataset_path, output_path):
results
=
evaluate_incorrect_code_samples_again
(
results
,
apps
,
10
)
results
=
evaluate_incorrect_code_samples_again
(
results
,
apps
,
10
)
save_jsonl
(
results
,
output_path
)
save_jsonl
(
results
,
output_path
)
if
__name__
==
"__main__"
:
cfg
=
read_config
()
evaluate
(
cfg
[
"sample"
][
"sample_result_path"
],
cfg
[
"apps"
],
cfg
[
"evaluate"
][
"evaluate_result_path"
],
)
step1_run.py
0 → 100644
View file @
ecf95207
from
utils
import
read_config
from
utils_vllm
import
vllm_chatcomplete
from
step1_sample_apps
import
mk_sample_prompt
from
step1_evaluate_code
import
evaluate
from
step1_sort_split_dataset
import
sort_and_split_dataset
if
__name__
==
"__main__"
:
cfg
=
read_config
()
mk_sample_prompt
(
cfg
[
"model"
],
cfg
[
"apps"
],
cfg
[
"sample"
][
"sample_prompt_path"
])
vllm_chatcomplete
(
cfg
[
"model"
],
cfg
[
"sample"
][
"sample_prompt_path"
],
cfg
[
"sample"
][
"sample_result_path"
],
cfg
[
"sample"
][
"sampling_params"
],
)
evaluate
(
cfg
[
"sample"
][
"sample_result_path"
],
cfg
[
"apps"
],
cfg
[
"evaluate"
][
"evaluate_result_path"
],
)
sort_and_split_dataset
(
cfg
[
"evaluate"
][
"evaluate_result_path"
],
cfg
[
"dataset"
][
"train_path"
],
cfg
[
"dataset"
][
"test_path"
],
cfg
[
"dataset"
][
"minimal_test_path"
],
cfg
[
"sample"
][
"sampling_params"
][
"n"
]
)
\ No newline at end of file
step1_sample_apps.py
View file @
ecf95207
...
@@ -60,16 +60,3 @@ def mk_sample_prompt(model_path, apps_path, output_path):
...
@@ -60,16 +60,3 @@ def mk_sample_prompt(model_path, apps_path, output_path):
print
(
f
"size of dataset: {len(prompts)}"
)
print
(
f
"size of dataset: {len(prompts)}"
)
save_jsonl
(
prompts
,
output_path
)
save_jsonl
(
prompts
,
output_path
)
if
__name__
==
"__main__"
:
cfg
=
read_config
()
mk_sample_prompt
(
cfg
[
"model"
],
cfg
[
"apps"
],
cfg
[
"sample"
][
"sample_prompt_path"
])
from
utils_vllm
import
vllm_chatcomplete
vllm_chatcomplete
(
cfg
[
"model"
],
cfg
[
"sample"
][
"sample_prompt_path"
],
cfg
[
"sample"
][
"sample_result_path"
],
cfg
[
"sample"
][
"sampling_params"
],
)
\ No newline at end of file
step1_sort_split_dataset.py
View file @
ecf95207
...
@@ -56,14 +56,3 @@ def sort_and_split_dataset(raw_dataset_path, new_train_path, new_test_path, mini
...
@@ -56,14 +56,3 @@ def sort_and_split_dataset(raw_dataset_path, new_train_path, new_test_path, mini
save_jsonl
(
new_train
,
new_train_path
)
save_jsonl
(
new_train
,
new_train_path
)
save_jsonl
(
new_test
,
new_test_path
)
save_jsonl
(
new_test
,
new_test_path
)
save_jsonl
(
minimal_test
,
minimal_test_path
)
save_jsonl
(
minimal_test
,
minimal_test_path
)
if
__name__
==
"__main__"
:
cfg
=
read_config
()
sort_and_split_dataset
(
cfg
[
"evaluate"
][
"evaluate_result_path"
],
cfg
[
"dataset"
][
"train_path"
],
cfg
[
"dataset"
][
"test_path"
],
cfg
[
"dataset"
][
"minimal_test_path"
],
cfg
[
"sample"
][
"sampling_params"
][
"n"
]
)
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