-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implement data-model sandbox, with refactoring existing DJ's features…
… and tools (#291) * refactor for data-model sandbox: - [x] basic sandbox pipelines and hooks - [x] basic classes for evaluator, model_executors, taking modelscope_executor as an example - [WIP] add docs for sandbox (how to use and how to develop) - [WIP] local test with demo - [TODO] merge two evaluators from other under-reviewed PRs * + add missing args for dataset sampling * * make the simplest sandbox loop work * + add args that are updated recently * + make data quality evaluator work + support both path and dict for side configs * * make async work * * make model training work * + add more log for unittest * * avoid failure for tagging OPs * * rename single test funcs in unittest * * fix for unittest * * refine model train executor args * * specify the run_type by the type arg in extra configs * + Add docs for sandbox * update docs for DJ_SORA and homepage (ZH) * + Add English docs for added contents --------- Co-authored-by: lielin.hyl <[email protected]>
- Loading branch information
Showing
23 changed files
with
1,457 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
type: dj_text_quality_classifier |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"type": "modelscope", | ||
"model_name": "iic/nlp_gpt3_text-generation_chinese-base", | ||
"trainer_name": "nlp-base-trainer", | ||
"key_remapping": { | ||
"text": "src_txt" | ||
}, | ||
"train": { | ||
"max_epochs": 3, | ||
"lr_scheduler": { | ||
"type": "StepLR", | ||
"step_size": 2, | ||
"options": { | ||
"by_epoch": false | ||
} | ||
}, | ||
"optimizer": { | ||
"type": "AdamW", | ||
"lr": 3e-4 | ||
}, | ||
"dataloader": { | ||
"batch_size_per_gpu": 2, | ||
"workers_per_gpu": 0 | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
type: modelscope | ||
model_name: "iic/nlp_gpt3_text-generation_chinese-base" | ||
trainer_name: "nlp-base-trainer" | ||
key_remapping: | ||
text: "src_txt" | ||
train: | ||
max_epochs: 2 | ||
lr_scheduler: | ||
type: "StepLR" | ||
step_size: 2 | ||
options: | ||
by_epoch: false | ||
optimizer: | ||
type: "AdamW" | ||
lr: 0.0003 | ||
dataloader: | ||
batch_size_per_gpu: 2 | ||
workers_per_gpu: 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Sandbox config example for dataset | ||
|
||
# global parameters | ||
project_name: 'demo-sandbox' | ||
dataset_path: './demos/data/demo-dataset.jsonl' # path to your dataset directory or file | ||
np: 4 # number of subprocess to process your dataset | ||
|
||
export_path: './outputs/demo-sandbox/demo-sandbox.jsonl' | ||
|
||
# sandbox configs | ||
# for refining recipe using k-sigma rules | ||
path_k_sigma_recipe: './outputs/demo-sandbox/k_sigma_new_recipe.yaml' | ||
|
||
# for gpt3 quality classifier as data evaluator | ||
data_eval_config: 'configs/demo/sandbox/gpt3_data_quality_eval_config.yaml' | ||
#data_eval_config: | ||
# type: dj_text_quality_classifier | ||
|
||
# for gpt3 model training | ||
model_train_config: 'configs/demo/sandbox/gpt3_extra_train_config.json' | ||
|
||
# process schedule | ||
# a list of several process operators with their arguments | ||
process: | ||
- language_id_score_filter: | ||
lang: 'zh' | ||
min_score: 0.5 |
Oops, something went wrong.