bilibili / Index-1.9B

A SOTA lightweight multilingual LLM
Apache License 2.0
879 stars 48 forks source link

如何微调? #16

Open jasonisme123 opened 3 months ago

asirgogogo commented 3 months ago

可以参考 https://github.com/datawhalechina/self-llm/tree/master/bilibili_Index-1.9B

asirgogogo commented 3 months ago

hi~,新增了finetune的代码 https://github.com/bilibili/Index-1.9B/blob/main/finetune/README.md

Moemu commented 1 month ago

hi~,新增了finetune的代码 https://github.com/bilibili/Index-1.9B/blob/main/finetune/README.md

这个“指令集构建”好像不支持具有上下文的对话吧?

Moemu commented 1 month ago

而且在train.sh中,不应该使用python -m torch.distributed.launch,这已经在torch 2.0版本被弃用,应该使用torchrun

asirgogogo commented 1 month ago

如果想要微调多轮对话(具有上下文的话),你需要修改finetune.py中的process_func函数,对你的多轮对话数据进行适配(他是非常灵活的),多轮对话的拼接格式“{system}reserved_0{human}reserved_1{assistant}...reserved_0{human}reserved_1{assistant}”

关于启动方式,python -m torch.distributed.launch的方式依然适用,当然你也可以修改为 torchrun --nnodes 1 --nproc_per_node=4 --node_rank=0 --master_addr=your_ip --master_port=your_port finetune.py