data-juicer
data-juicer copied to clipboard
sandbox 的trainModelHook是否支持训练本地模型和自定义模型
Before Asking 在提问之前
-
[x] I have read the README carefully. 我已经仔细阅读了 README 上的操作指引。
-
[x] I have pulled the latest code of main branch to run again and the problem still existed. 我已经拉取了主分支上最新的代码,重新运行之后,问题仍不能解决。
Search before asking 先搜索,再提问
- [x] I have searched the Data-Juicer issues and found no similar questions. 我已经在 issue列表 中搜索但是没有发现类似的问题。
Question
sandbox 的trainModel配置文件替换成自定义的配置后,执行报错如下:
File "/usr/local/lib/python3.10/dist-packages/modelscope/trainers/builder.py", line 39, in build_trainer
return build_from_cfg(cfg, TRAINERS, default_args=default_args)
│ │ │ └ {'model': '/models/Qwen2.5-7B-Instruct', 'train_dataset': None, 'eval_dataset': None, 'work_dir': './outputs/sandbox...
│ │ └ Registry (trainers)
│ │ group_name=default, modules=['dummy', 'trainer', 'nlp-base-trainer', 'nlp-veco-trainer']
│ │
│ └ {'type': 'nlp-base-trainer'}
└ <function build_from_cfg at 0x7fb0f5b71900>
File "/usr/local/lib/python3.10/dist-packages/modelscope/utils/registry.py", line 214, in build_from_cfg
raise type(e)(f'{obj_cls.name}: {e}') from e
AttributeError: NlpEpochBasedTrainer: 'ConfigDict' object has no attribute 'model'
Additional 额外信息
sandbox配置信息
global parameters
project_name: 'demo-sandbox' experiment_name: 'demo-sandbox-run0' # for wandb tracer name work_dir: './outputs/demo-sandbox' # the default output dir for meta logging hpo_config: null # path to a configuration file when using auto-HPO tool.
configs for each job, the jobs will be executed according to the order in the list
probe_job_configs:
- hook: 'ProbeViaAnalyzerHook' meta_name: 'analysis_ori_data' dj_configs: 'configs/demo/process.yaml' extra_configs:
refine_recipe_job_configs:
- hook: 'RefineRecipeViaKSigmaHook' meta_name: 'analysis_ori_data' dj_configs: 'configs/demo/process.yaml' extra_configs: path_k_sigma_recipe: './outputs/demo-customed-0418/k_sigma_new_recipe.yaml'
execution_job_configs:
- hook: 'ProcessDataHook' meta_name: dj_configs: './outputs/demo-customed-0418/k_sigma_new_recipe.yaml' extra_configs:
- hook: 'TrainModelHook' meta_name: dj_configs: extra_configs: 'configs/demo/sandbox/qwen25_14B_extra_train_config.json'
evaluation_job_configs:
- hook: 'ProbeViaAnalyzerHook' meta_name: 'analysis_processed_data' dj_configs: 'configs/demo/process.yaml' extra_configs:
- hook: 'EvaluateDataHook' meta_name: 'eval_data' dj_configs: extra_configs: 'configs/demo/sandbox/gpt3_data_quality_eval_config.yaml'
模型训练配置文件 { "type": "modelscope", "dataset_path": "./outputs/demo-customed-0418/data.jsonl", "device": "0,1,2,3", "work_dir": "./outputs/sandbox-train/", "model_name": "./models/Qwen2.5-7B-Instruct", "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": 3e-5 }, "dataloader": { "batch_size_per_gpu": 16, "workers_per_gpu": 0 } } }