{"id":19054696,"url":"https://github.com/ssbuild/pytorch-task-example","last_synced_at":"2025-10-09T17:05:56.380Z","repository":{"id":64608397,"uuid":"576140188","full_name":"ssbuild/pytorch-task-example","owner":"ssbuild","description":"deep training task","archived":false,"fork":false,"pushed_at":"2023-04-28T12:11:02.000Z","size":1050,"stargazers_count":29,"open_issues_count":0,"forks_count":8,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-18T12:17:52.466Z","etag":null,"topics":[],"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":"2022-12-09T05:10:59.000Z","updated_at":"2024-10-23T13:14:26.000Z","dependencies_parsed_at":"2025-04-17T23:39:12.189Z","dependency_job_id":"cc546692-fe7d-4665-8792-9a8086307eb1","html_url":"https://github.com/ssbuild/pytorch-task-example","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssbuild%2Fpytorch-task-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssbuild%2Fpytorch-task-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssbuild%2Fpytorch-task-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssbuild%2Fpytorch-task-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ssbuild","download_url":"https://codeload.github.com/ssbuild/pytorch-task-example/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250554388,"owners_count":21449606,"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":[],"created_at":"2024-11-08T23:39:23.998Z","updated_at":"2025-10-09T17:05:51.353Z","avatar_url":"https://github.com/ssbuild.png","language":"Python","readme":"## 安装\r\n\r\n- pip install -U deep_training \u003e= 0.1.0\r\n- 当前文档版本pypi 0.1.0\r\n\r\n## 更新详情\r\n\r\n  - [deep_training](https://github.com/ssbuild/deep_training)\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  - [poetry_training](https://github.com/ssbuild/poetry_training)\r\n\r\n\r\n## 目录\r\n- pretraining 主流预训练模型\r\n- task_classify 分类模型\r\n- task_extract_ner 序列抽取模型\r\n- tast_extract_relation 关系抽取模型\r\n- tast_extract_event 事件抽取模型\r\n- task_generate 文本生成模型\r\n- task_grammatical_error_correction 文本纠错模型\r\n- task_sentence_vector 句向量模型\r\n- task_custom_muti_gpu 更多自定义训练操作，例如多卡训练例子， 模型转换onnx 等一些列自定义操作\r\n\r\n## 对抗训练就在配置里增加一个选项\r\n    'adv': {\r\n        'mode': 'fgm', # None, fgm, fgsm_local, fgsm(不推荐), pgd, free_local, free(不推荐)\r\n        'emb_name': 'embedding',\r\n        'attack_iters': 2,  # pgd\r\n        'minibatch_replays': 2,  # free\r\n        'alpha': 0.5,  # pgd,fgsm\r\n        'epsilon': 0.5,  # pgd,fgm\r\n    }\r\n\r\n## 层次分解位置编码，让BERT可以处理超长文本\r\n    'hierarchical_position':  0.4 \r\n\r\n## 导出onnx模型 通常只需要三步\r\n\r\n    第一步，参数配置 convert_onnx = True\r\n    第二步 加载权重例子\r\n    model = MyTransformer.load_from_checkpoint('./best.pt', config=config, model_args=model_args,\r\n                                                   training_args=training_args)\r\n    第三步 #导出onnx模型\r\n    model.convert_to_onnx('./best.onnx')\r\n\r\n## 多卡训练策略 strategy , 通常只需要一步\r\n    修改参数配置 devices = N \r\n\r\n    # Available names: bagua, colossalai, ddp, ddp_find_unused_parameters_false, ddp_fork,\r\n    # ddp_fork_find_unused_parameters_false, ddp_fully_sharded,\r\n    # ddp_notebook, ddp_notebook_find_unused_parameters_false, ddp_sharded,\r\n    # ddp_sharded_find_unused_parameters_false, ddp_sharded_spawn,\r\n    # ddp_sharded_spawn_find_unused_parameters_false,\r\n    # ddp_spawn, ddp_spawn_find_unused_parameters_false,\r\n    # deepspeed, deepspeed_stage_1, deepspeed_stage_2, deepspeed_stage_2_offload,\r\n    # deepspeed_stage_3, deepspeed_stage_3_offload, deepspeed_stage_3_offload_nvme,\r\n    # dp, fsdp, fsdp_native, fsdp_native_full_shard_offload, horovod, hpu_parallel,\r\n    # hpu_single, ipu_strategy, single_device, single_tpu, tpu_spawn, tpu_spawn_debug\"\r\n\r\n## 大模型Lora训练\r\n    \r\n    [chatyuan_finetuning](https://github.com/ssbuild/chatyuan_finetuning)\r\n    [prompt_finetuning](https://github.com/ssbuild/prompt_finetuning)\r\n\r\n## 愿景\r\n\r\n创建一个模型工厂, 轻量且高效的训练程序，让训练模型更容易,更轻松上手。\r\n\r\n## 交流\r\n\r\nQQ交流群：185144988\r\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fssbuild%2Fpytorch-task-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fssbuild%2Fpytorch-task-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fssbuild%2Fpytorch-task-example/lists"}