{"id":19054677,"url":"https://github.com/ssbuild/t5_finetuning","last_synced_at":"2025-04-24T03:22:21.703Z","repository":{"id":117214502,"uuid":"602363567","full_name":"ssbuild/t5_finetuning","owner":"ssbuild","description":"clue chatyuan finetuning","archived":false,"fork":false,"pushed_at":"2025-03-10T10:49:08.000Z","size":133,"stargazers_count":17,"open_issues_count":2,"forks_count":4,"subscribers_count":1,"default_branch":"dev","last_synced_at":"2025-04-18T12:17:50.324Z","etag":null,"topics":["adalora","chat","chatyuan","clue","lora","qlora","t5"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ssbuild.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-02-16T03:30:17.000Z","updated_at":"2025-01-10T06:46:16.000Z","dependencies_parsed_at":"2023-07-14T05:31:51.379Z","dependency_job_id":"9e32598c-37cc-4628-883d-70b77e6e3edb","html_url":"https://github.com/ssbuild/t5_finetuning","commit_stats":null,"previous_names":["ssbuild/t5_finetuning","ssbuild/chatyuan_finetuning"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssbuild%2Ft5_finetuning","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssbuild%2Ft5_finetuning/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssbuild%2Ft5_finetuning/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssbuild%2Ft5_finetuning/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ssbuild","download_url":"https://codeload.github.com/ssbuild/t5_finetuning/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250552793,"owners_count":21449275,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["adalora","chat","chatyuan","clue","lora","qlora","t5"],"created_at":"2024-11-08T23:39:20.633Z","updated_at":"2025-04-24T03:22:21.673Z","avatar_url":"https://github.com/ssbuild.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\r\n\r\n```text\r\n    2024-04-22 简化\r\n    2023-10-09 support accelerator trainer\r\n    2023-10-07 support colossalai trainer\r\n    2023-09-26 support transformers trainer\r\n    2023-08-02 增加 muti lora infer 例子, 手动升级 aigc_zoo , pip install -U git+https://github.com/ssbuild/deep_training.zoo.git --force-reinstall --no-deps\r\n\t2023-06-13 support resize_token_embeddings\r\n    2023-06-01 支持lora deepspeed 训练，0.1.9 和 0.1.10合并\r\n    2023-05-27 add qlora transformers\u003e=4.30\r\n    2023-05-24 升级 lora\r\n```\r\n\r\n## update information\r\n   - [deep_training](https://github.com/ssbuild/deep_training)\r\n   - t5 训练精度推荐使用 32 \r\n\r\n## install\r\n  - pip install -U -r requirements.txt\r\n  - 如果无法安装， 可以切换官方源 pip install -i https://pypi.org/simple -U -r requirements.txt\r\n\r\n\r\n## weight\r\n\r\n- [ChatYuan-large-v1](https://huggingface.co/ClueAI/ChatYuan-large-v1)\r\n- [ChatYuan-large-v2](https://huggingface.co/ClueAI/ChatYuan-large-v2)\r\n    \r\n    \r\n## data\r\n[open data](https://github.com/ssbuild/open_data)\r\n```text\r\np prefix  optional\r\nq question optional\r\na answer   must\r\n\r\n```\r\n```json\r\n {\r\n    \"id\": 0, \r\n    \"p\": \"我是qwen训练的模型\",\r\n    \"paragraph\": [\r\n        {\r\n           \"q\": \"你好\",\r\n           \"a\": \"我是机器人，有什么可以帮助你的？\"\r\n        },\r\n         {\r\n             \"q\": \"从南京到上海的路线\",\r\n             \"a\":  \"你好，南京到上海的路线如下：1. 南京到上海，可以乘坐南京地铁1号线，在南京站乘坐轨道交通1号线。2. 南京到浦东机场，可以搭乘上海地铁1号，在陆家嘴站乘坐地铁1线，在浦东国际机场站乘坐机场快线，前往上海浦东国际机场。3. 上海到南京，可以换乘上海地铁2号线，从南京站换乘地铁2线，再从南京南站换乘地铁1路，然后到达上海站\"\r\n         }\r\n     ]\r\n }\r\n\r\n```\r\n\r\n或者\r\n\r\n```json\r\n {\r\n    \"id\": 0,\r\n    \"conversations\": [\r\n      {\r\n        \"from\": \"system\",\r\n        \"value\": \"我是qwen训练的模型\"\r\n      },\r\n      {\r\n        \"from\": \"user\",\r\n        \"value\": \"你好\"\r\n      },\r\n      {\r\n        \"from\": \"assistant\",\r\n        \"value\": \"我是机器人，有什么可以帮助你的？\"\r\n      },\r\n      {\r\n        \"from\": \"user\",\r\n        \"value\": \"从南京到上海的路线\"\r\n      },\r\n      {\r\n        \"from\": \"assistant\",\r\n        \"value\": \"你好，南京到上海的路线如下：1. 南京到上海，可以乘坐南京地铁1号线，在南京站乘坐轨道交通1号线。2. 南京到浦东机场，可以搭乘上海地铁1号，在陆家嘴站乘坐地铁1线，在浦东国际机场站乘坐机场快线，前往上海浦东国际机场。3. 上海到南京，可以换乘上海地铁2号线，从南京站换乘地铁2线，再从南京南站换乘地铁1路，然后到达上海站\"\r\n      }\r\n     ]\r\n }\r\n```\r\n\r\n\r\n# 使用方法\r\n    默认不使用滑动窗口\r\n    data_conf = {\r\n        'stride': 0,\r\n        #滑动窗口 , 数据多则相应增大，否则减小 ,stride \u003c=0 则禁用滑动窗口\r\n    }\r\n\r\n\r\n\r\n\r\n\r\n## infer\r\n    # infer_finetuning.py 推理微调模型\r\n    # infer_lora_finetuning.py 推理微调模型\r\n    # infer_ptuning.py 推理p-tuning-v2微调模型\r\n     python infer_finetuning.py\r\n\r\n\r\n\r\n## training\r\n```text\r\n    # 制作数据\r\n    cd scripts\r\n    bash train_full.sh -m dataset \r\n    or\r\n    bash train_lora.sh -m dataset \r\n    or\r\n    bash train_ptv2.sh -m dataset \r\n    \r\n    注: num_process_worker 为多进程制作数据 ， 如果数据量较大 ， 适当调大至cpu数量\r\n    dataHelper.make_dataset_with_args(data_args.train_file,mixed_data=False, shuffle=True,mode='train',num_process_worker=0)\r\n    \r\n    # 全参数训练 \r\n        bash train_full.sh -m train\r\n        \r\n    # lora adalora ia3 \r\n        bash train_lora.sh -m train\r\n        \r\n    # ptv2\r\n        bash train_ptv2.sh -m train\r\n```\r\n   \r\n## 训练参数\r\n[训练参数](args.MD)\r\n\r\n## 友情链接\r\n\r\n- [pytorch-task-example](https://github.com/ssbuild/pytorch-task-example)\r\n- [tf-task-example](https://github.com/ssbuild/tf-task-example)\r\n- [chatmoss_finetuning](https://github.com/ssbuild/chatmoss_finetuning)\r\n- [chatglm_finetuning](https://github.com/ssbuild/chatglm_finetuning)\r\n- [t5_finetuning](https://github.com/ssbuild/t5_finetuning)\r\n- [llm_finetuning](https://github.com/ssbuild/llm_finetuning)\r\n- [llm_rlhf](https://github.com/ssbuild/llm_rlhf)\r\n- [chatglm_rlhf](https://github.com/ssbuild/chatglm_rlhf)\r\n- [t5_rlhf](https://github.com/ssbuild/t5_rlhf)\r\n- [rwkv_finetuning](https://github.com/ssbuild/rwkv_finetuning)\r\n- [baichuan_finetuning](https://github.com/ssbuild/baichuan_finetuning)\r\n\r\n## \r\n    纯粹而干净的代码","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fssbuild%2Ft5_finetuning","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fssbuild%2Ft5_finetuning","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fssbuild%2Ft5_finetuning/lists"}