Upload folder using huggingface_hub
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- .env.local +42 -0
- .gitattributes +15 -0
- .pre-commit-config.yaml +28 -0
- CITATION.cff +44 -0
- LICENSE +201 -0
- MANIFEST.in +1 -0
- Makefile +24 -0
- README.md +973 -0
- README_zh.md +974 -0
- data/README.md +475 -0
- data/README_zh.md +478 -0
- data/alpaca_en_demo.json +0 -0
- data/alpaca_zh_demo.json +0 -0
- data/c4_demo.jsonl +0 -0
- data/convert_hapticcap_to_llava.py +81 -0
- data/dataset_info.json +766 -0
- data/dpo_en_demo.json +0 -0
- data/dpo_zh_demo.json +0 -0
- data/glaive_toolcall_en_demo.json +0 -0
- data/glaive_toolcall_zh_demo.json +0 -0
- data/identity.json +457 -0
- data/kto_en_demo.json +0 -0
- data/mllm_audio_demo.json +47 -0
- data/mllm_demo.json +142 -0
- data/mllm_demo_data/1.jpg +0 -0
- data/mllm_demo_data/1.mp3 +3 -0
- data/mllm_demo_data/1.mp4 +3 -0
- data/mllm_demo_data/2.avi +3 -0
- data/mllm_demo_data/2.jpg +0 -0
- data/mllm_demo_data/2.wav +0 -0
- data/mllm_demo_data/3.flac +3 -0
- data/mllm_demo_data/3.jpg +0 -0
- data/mllm_demo_data/3.mp4 +3 -0
- data/mllm_demo_data/4.mp3 +0 -0
- data/mllm_demo_data/4.mp4 +0 -0
- data/mllm_video_audio_demo.json +56 -0
- data/mllm_video_demo.json +47 -0
- data/reason_tool_use_demo_50.jsonl +0 -0
- data/v1_sft_demo.jsonl +0 -0
- data/v1_sft_demo.yaml +8 -0
- data/wiki_demo.txt +0 -0
- eval_scan2cap.sh +36 -0
- eval_threeod.sh +36 -0
- examples/README.md +304 -0
- examples/accelerate/fsdp_config.yaml +25 -0
- examples/accelerate/fsdp_config_offload.yaml +25 -0
- examples/deepspeed/ds_z0_config.json +28 -0
- examples/deepspeed/ds_z2_config.json +28 -0
- examples/deepspeed/ds_z2_offload_config.json +32 -0
- examples/deepspeed/ds_z3_config.json +30 -0
.env.local
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Note: actually we do not support .env, just for reference
|
| 2 |
+
# api
|
| 3 |
+
API_HOST=
|
| 4 |
+
API_PORT=
|
| 5 |
+
API_KEY=
|
| 6 |
+
API_MODEL_NAME=
|
| 7 |
+
API_VERBOSE=
|
| 8 |
+
FASTAPI_ROOT_PATH=
|
| 9 |
+
MAX_CONCURRENT=
|
| 10 |
+
# general
|
| 11 |
+
DISABLE_VERSION_CHECK=
|
| 12 |
+
FORCE_CHECK_IMPORTS=
|
| 13 |
+
ALLOW_EXTRA_ARGS=
|
| 14 |
+
LLAMAFACTORY_VERBOSITY=
|
| 15 |
+
USE_MODELSCOPE_HUB=
|
| 16 |
+
USE_OPENMIND_HUB=
|
| 17 |
+
USE_RAY=
|
| 18 |
+
RECORD_VRAM=
|
| 19 |
+
OPTIM_TORCH=
|
| 20 |
+
NPU_JIT_COMPILE=
|
| 21 |
+
# torchrun
|
| 22 |
+
FORCE_TORCHRUN=
|
| 23 |
+
MASTER_ADDR=
|
| 24 |
+
MASTER_PORT=
|
| 25 |
+
NNODES=
|
| 26 |
+
NODE_RANK=
|
| 27 |
+
NPROC_PER_NODE=
|
| 28 |
+
# wandb
|
| 29 |
+
WANDB_DISABLED=
|
| 30 |
+
WANDB_PROJECT=
|
| 31 |
+
WANDB_API_KEY=
|
| 32 |
+
# gradio ui
|
| 33 |
+
GRADIO_SHARE=
|
| 34 |
+
GRADIO_SERVER_NAME=
|
| 35 |
+
GRADIO_SERVER_PORT=
|
| 36 |
+
GRADIO_ROOT_PATH=
|
| 37 |
+
GRADIO_IPV6=
|
| 38 |
+
# setup
|
| 39 |
+
ENABLE_SHORT_CONSOLE=
|
| 40 |
+
# reserved (do not use)
|
| 41 |
+
LLAMABOARD_ENABLED=
|
| 42 |
+
LLAMABOARD_WORKDIR=
|
.gitattributes
CHANGED
|
@@ -33,3 +33,18 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
data/mllm_demo_data/1.mp3 filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
data/mllm_demo_data/1.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 38 |
+
data/mllm_demo_data/2.avi filter=lfs diff=lfs merge=lfs -text
|
| 39 |
+
data/mllm_demo_data/3.flac filter=lfs diff=lfs merge=lfs -text
|
| 40 |
+
data/mllm_demo_data/3.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 41 |
+
logs/20251028/ckpts__Qwen2.5-Omni-3B-sft-full/20251028_173258_samples_scannet_4frames.jsonl filter=lfs diff=lfs merge=lfs -text
|
| 42 |
+
logs/20251028/ckpts__Qwen2.5-Omni-3B-sft-full/20251028_225632_samples_scannet_6frames.jsonl filter=lfs diff=lfs merge=lfs -text
|
| 43 |
+
logs/20251028/ckpts__Qwen2.5-Omni-3B-sft-lora/20251028_155014_samples_scannet_4frames.jsonl filter=lfs diff=lfs merge=lfs -text
|
| 44 |
+
logs/20251030/ckpts__Qwen2.5-Omni-3B-sftv2-full/20251030_050021_samples_scannet_6frames.jsonl filter=lfs diff=lfs merge=lfs -text
|
| 45 |
+
src/llamafactory/data/__pycache__/mm_plugin.cpython-311.pyc filter=lfs diff=lfs merge=lfs -text
|
| 46 |
+
src/llamafactory/extras/__pycache__/constants.cpython-311.pyc filter=lfs diff=lfs merge=lfs -text
|
| 47 |
+
src/lmms-eval/lmms_eval/tasks/mmmu/arial.ttf filter=lfs diff=lfs merge=lfs -text
|
| 48 |
+
src/lmms-eval/lmms_eval/tasks/scan2cap/caption_eval/meteor/meteor-1.5.jar filter=lfs diff=lfs merge=lfs -text
|
| 49 |
+
src/lmms-eval/lmms_eval/tasks/scan2cap/caption_eval/tokenizer/stanford-corenlp-3.4.1.jar filter=lfs diff=lfs merge=lfs -text
|
| 50 |
+
src/lmms-eval/tools/live_bench/live_bench/data_generator/example/example_website.png filter=lfs diff=lfs merge=lfs -text
|
.pre-commit-config.yaml
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
repos:
|
| 2 |
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
| 3 |
+
rev: v6.0.0
|
| 4 |
+
hooks:
|
| 5 |
+
- id: check-ast
|
| 6 |
+
- id: check-added-large-files
|
| 7 |
+
args: ['--maxkb=25000']
|
| 8 |
+
- id: check-merge-conflict
|
| 9 |
+
- id: check-yaml
|
| 10 |
+
- id: debug-statements
|
| 11 |
+
- id: end-of-file-fixer
|
| 12 |
+
- id: trailing-whitespace
|
| 13 |
+
args: [--markdown-linebreak-ext=md]
|
| 14 |
+
- id: no-commit-to-branch
|
| 15 |
+
args: ['--branch', 'main']
|
| 16 |
+
|
| 17 |
+
- repo: https://github.com/asottile/pyupgrade
|
| 18 |
+
rev: v3.20.0
|
| 19 |
+
hooks:
|
| 20 |
+
- id: pyupgrade
|
| 21 |
+
args: [--py39-plus]
|
| 22 |
+
|
| 23 |
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
| 24 |
+
rev: v0.13.2
|
| 25 |
+
hooks:
|
| 26 |
+
- id: ruff
|
| 27 |
+
args: [--fix]
|
| 28 |
+
- id: ruff-format
|
CITATION.cff
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
cff-version: 1.2.0
|
| 2 |
+
date-released: 2024-03
|
| 3 |
+
message: "If you use this software, please cite it as below."
|
| 4 |
+
authors:
|
| 5 |
+
- family-names: "Zheng"
|
| 6 |
+
given-names: "Yaowei"
|
| 7 |
+
- family-names: "Zhang"
|
| 8 |
+
given-names: "Richong"
|
| 9 |
+
- family-names: "Zhang"
|
| 10 |
+
given-names: "Junhao"
|
| 11 |
+
- family-names: "Ye"
|
| 12 |
+
given-names: "Yanhan"
|
| 13 |
+
- family-names: "Luo"
|
| 14 |
+
given-names: "Zheyan"
|
| 15 |
+
- family-names: "Feng"
|
| 16 |
+
given-names: "Zhangchi"
|
| 17 |
+
- family-names: "Ma"
|
| 18 |
+
given-names: "Yongqiang"
|
| 19 |
+
title: "LlamaFactory: Unified Efficient Fine-Tuning of 100+ Language Models"
|
| 20 |
+
url: "https://arxiv.org/abs/2403.13372"
|
| 21 |
+
preferred-citation:
|
| 22 |
+
type: conference-paper
|
| 23 |
+
conference:
|
| 24 |
+
name: "Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 3: System Demonstrations)"
|
| 25 |
+
authors:
|
| 26 |
+
- family-names: "Zheng"
|
| 27 |
+
given-names: "Yaowei"
|
| 28 |
+
- family-names: "Zhang"
|
| 29 |
+
given-names: "Richong"
|
| 30 |
+
- family-names: "Zhang"
|
| 31 |
+
given-names: "Junhao"
|
| 32 |
+
- family-names: "Ye"
|
| 33 |
+
given-names: "Yanhan"
|
| 34 |
+
- family-names: "Luo"
|
| 35 |
+
given-names: "Zheyan"
|
| 36 |
+
- family-names: "Feng"
|
| 37 |
+
given-names: "Zhangchi"
|
| 38 |
+
- family-names: "Ma"
|
| 39 |
+
given-names: "Yongqiang"
|
| 40 |
+
title: "LlamaFactory: Unified Efficient Fine-Tuning of 100+ Language Models"
|
| 41 |
+
url: "https://arxiv.org/abs/2403.13372"
|
| 42 |
+
year: 2024
|
| 43 |
+
publisher: "Association for Computational Linguistics"
|
| 44 |
+
address: "Bangkok, Thailand"
|
LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Apache License
|
| 2 |
+
Version 2.0, January 2004
|
| 3 |
+
http://www.apache.org/licenses/
|
| 4 |
+
|
| 5 |
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
| 6 |
+
|
| 7 |
+
1. Definitions.
|
| 8 |
+
|
| 9 |
+
"License" shall mean the terms and conditions for use, reproduction,
|
| 10 |
+
and distribution as defined by Sections 1 through 9 of this document.
|
| 11 |
+
|
| 12 |
+
"Licensor" shall mean the copyright owner or entity authorized by
|
| 13 |
+
the copyright owner that is granting the License.
|
| 14 |
+
|
| 15 |
+
"Legal Entity" shall mean the union of the acting entity and all
|
| 16 |
+
other entities that control, are controlled by, or are under common
|
| 17 |
+
control with that entity. For the purposes of this definition,
|
| 18 |
+
"control" means (i) the power, direct or indirect, to cause the
|
| 19 |
+
direction or management of such entity, whether by contract or
|
| 20 |
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
| 21 |
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
| 22 |
+
|
| 23 |
+
"You" (or "Your") shall mean an individual or Legal Entity
|
| 24 |
+
exercising permissions granted by this License.
|
| 25 |
+
|
| 26 |
+
"Source" form shall mean the preferred form for making modifications,
|
| 27 |
+
including but not limited to software source code, documentation
|
| 28 |
+
source, and configuration files.
|
| 29 |
+
|
| 30 |
+
"Object" form shall mean any form resulting from mechanical
|
| 31 |
+
transformation or translation of a Source form, including but
|
| 32 |
+
not limited to compiled object code, generated documentation,
|
| 33 |
+
and conversions to other media types.
|
| 34 |
+
|
| 35 |
+
"Work" shall mean the work of authorship, whether in Source or
|
| 36 |
+
Object form, made available under the License, as indicated by a
|
| 37 |
+
copyright notice that is included in or attached to the work
|
| 38 |
+
(an example is provided in the Appendix below).
|
| 39 |
+
|
| 40 |
+
"Derivative Works" shall mean any work, whether in Source or Object
|
| 41 |
+
form, that is based on (or derived from) the Work and for which the
|
| 42 |
+
editorial revisions, annotations, elaborations, or other modifications
|
| 43 |
+
represent, as a whole, an original work of authorship. For the purposes
|
| 44 |
+
of this License, Derivative Works shall not include works that remain
|
| 45 |
+
separable from, or merely link (or bind by name) to the interfaces of,
|
| 46 |
+
the Work and Derivative Works thereof.
|
| 47 |
+
|
| 48 |
+
"Contribution" shall mean any work of authorship, including
|
| 49 |
+
the original version of the Work and any modifications or additions
|
| 50 |
+
to that Work or Derivative Works thereof, that is intentionally
|
| 51 |
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
| 52 |
+
or by an individual or Legal Entity authorized to submit on behalf of
|
| 53 |
+
the copyright owner. For the purposes of this definition, "submitted"
|
| 54 |
+
means any form of electronic, verbal, or written communication sent
|
| 55 |
+
to the Licensor or its representatives, including but not limited to
|
| 56 |
+
communication on electronic mailing lists, source code control systems,
|
| 57 |
+
and issue tracking systems that are managed by, or on behalf of, the
|
| 58 |
+
Licensor for the purpose of discussing and improving the Work, but
|
| 59 |
+
excluding communication that is conspicuously marked or otherwise
|
| 60 |
+
designated in writing by the copyright owner as "Not a Contribution."
|
| 61 |
+
|
| 62 |
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
| 63 |
+
on behalf of whom a Contribution has been received by Licensor and
|
| 64 |
+
subsequently incorporated within the Work.
|
| 65 |
+
|
| 66 |
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
| 67 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 68 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 69 |
+
copyright license to reproduce, prepare Derivative Works of,
|
| 70 |
+
publicly display, publicly perform, sublicense, and distribute the
|
| 71 |
+
Work and such Derivative Works in Source or Object form.
|
| 72 |
+
|
| 73 |
+
3. Grant of Patent License. Subject to the terms and conditions of
|
| 74 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 75 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 76 |
+
(except as stated in this section) patent license to make, have made,
|
| 77 |
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
| 78 |
+
where such license applies only to those patent claims licensable
|
| 79 |
+
by such Contributor that are necessarily infringed by their
|
| 80 |
+
Contribution(s) alone or by combination of their Contribution(s)
|
| 81 |
+
with the Work to which such Contribution(s) was submitted. If You
|
| 82 |
+
institute patent litigation against any entity (including a
|
| 83 |
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
| 84 |
+
or a Contribution incorporated within the Work constitutes direct
|
| 85 |
+
or contributory patent infringement, then any patent licenses
|
| 86 |
+
granted to You under this License for that Work shall terminate
|
| 87 |
+
as of the date such litigation is filed.
|
| 88 |
+
|
| 89 |
+
4. Redistribution. You may reproduce and distribute copies of the
|
| 90 |
+
Work or Derivative Works thereof in any medium, with or without
|
| 91 |
+
modifications, and in Source or Object form, provided that You
|
| 92 |
+
meet the following conditions:
|
| 93 |
+
|
| 94 |
+
(a) You must give any other recipients of the Work or
|
| 95 |
+
Derivative Works a copy of this License; and
|
| 96 |
+
|
| 97 |
+
(b) You must cause any modified files to carry prominent notices
|
| 98 |
+
stating that You changed the files; and
|
| 99 |
+
|
| 100 |
+
(c) You must retain, in the Source form of any Derivative Works
|
| 101 |
+
that You distribute, all copyright, patent, trademark, and
|
| 102 |
+
attribution notices from the Source form of the Work,
|
| 103 |
+
excluding those notices that do not pertain to any part of
|
| 104 |
+
the Derivative Works; and
|
| 105 |
+
|
| 106 |
+
(d) If the Work includes a "NOTICE" text file as part of its
|
| 107 |
+
distribution, then any Derivative Works that You distribute must
|
| 108 |
+
include a readable copy of the attribution notices contained
|
| 109 |
+
within such NOTICE file, excluding those notices that do not
|
| 110 |
+
pertain to any part of the Derivative Works, in at least one
|
| 111 |
+
of the following places: within a NOTICE text file distributed
|
| 112 |
+
as part of the Derivative Works; within the Source form or
|
| 113 |
+
documentation, if provided along with the Derivative Works; or,
|
| 114 |
+
within a display generated by the Derivative Works, if and
|
| 115 |
+
wherever such third-party notices normally appear. The contents
|
| 116 |
+
of the NOTICE file are for informational purposes only and
|
| 117 |
+
do not modify the License. You may add Your own attribution
|
| 118 |
+
notices within Derivative Works that You distribute, alongside
|
| 119 |
+
or as an addendum to the NOTICE text from the Work, provided
|
| 120 |
+
that such additional attribution notices cannot be construed
|
| 121 |
+
as modifying the License.
|
| 122 |
+
|
| 123 |
+
You may add Your own copyright statement to Your modifications and
|
| 124 |
+
may provide additional or different license terms and conditions
|
| 125 |
+
for use, reproduction, or distribution of Your modifications, or
|
| 126 |
+
for any such Derivative Works as a whole, provided Your use,
|
| 127 |
+
reproduction, and distribution of the Work otherwise complies with
|
| 128 |
+
the conditions stated in this License.
|
| 129 |
+
|
| 130 |
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
| 131 |
+
any Contribution intentionally submitted for inclusion in the Work
|
| 132 |
+
by You to the Licensor shall be under the terms and conditions of
|
| 133 |
+
this License, without any additional terms or conditions.
|
| 134 |
+
Notwithstanding the above, nothing herein shall supersede or modify
|
| 135 |
+
the terms of any separate license agreement you may have executed
|
| 136 |
+
with Licensor regarding such Contributions.
|
| 137 |
+
|
| 138 |
+
6. Trademarks. This License does not grant permission to use the trade
|
| 139 |
+
names, trademarks, service marks, or product names of the Licensor,
|
| 140 |
+
except as required for reasonable and customary use in describing the
|
| 141 |
+
origin of the Work and reproducing the content of the NOTICE file.
|
| 142 |
+
|
| 143 |
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
| 144 |
+
agreed to in writing, Licensor provides the Work (and each
|
| 145 |
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
| 146 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
| 147 |
+
implied, including, without limitation, any warranties or conditions
|
| 148 |
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
| 149 |
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
| 150 |
+
appropriateness of using or redistributing the Work and assume any
|
| 151 |
+
risks associated with Your exercise of permissions under this License.
|
| 152 |
+
|
| 153 |
+
8. Limitation of Liability. In no event and under no legal theory,
|
| 154 |
+
whether in tort (including negligence), contract, or otherwise,
|
| 155 |
+
unless required by applicable law (such as deliberate and grossly
|
| 156 |
+
negligent acts) or agreed to in writing, shall any Contributor be
|
| 157 |
+
liable to You for damages, including any direct, indirect, special,
|
| 158 |
+
incidental, or consequential damages of any character arising as a
|
| 159 |
+
result of this License or out of the use or inability to use the
|
| 160 |
+
Work (including but not limited to damages for loss of goodwill,
|
| 161 |
+
work stoppage, computer failure or malfunction, or any and all
|
| 162 |
+
other commercial damages or losses), even if such Contributor
|
| 163 |
+
has been advised of the possibility of such damages.
|
| 164 |
+
|
| 165 |
+
9. Accepting Warranty or Additional Liability. While redistributing
|
| 166 |
+
the Work or Derivative Works thereof, You may choose to offer,
|
| 167 |
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
| 168 |
+
or other liability obligations and/or rights consistent with this
|
| 169 |
+
License. However, in accepting such obligations, You may act only
|
| 170 |
+
on Your own behalf and on Your sole responsibility, not on behalf
|
| 171 |
+
of any other Contributor, and only if You agree to indemnify,
|
| 172 |
+
defend, and hold each Contributor harmless for any liability
|
| 173 |
+
incurred by, or claims asserted against, such Contributor by reason
|
| 174 |
+
of your accepting any such warranty or additional liability.
|
| 175 |
+
|
| 176 |
+
END OF TERMS AND CONDITIONS
|
| 177 |
+
|
| 178 |
+
APPENDIX: How to apply the Apache License to your work.
|
| 179 |
+
|
| 180 |
+
To apply the Apache License to your work, attach the following
|
| 181 |
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
| 182 |
+
replaced with your own identifying information. (Don't include
|
| 183 |
+
the brackets!) The text should be enclosed in the appropriate
|
| 184 |
+
comment syntax for the file format. We also recommend that a
|
| 185 |
+
file or class name and description of purpose be included on the
|
| 186 |
+
same "printed page" as the copyright notice for easier
|
| 187 |
+
identification within third-party archives.
|
| 188 |
+
|
| 189 |
+
Copyright [yyyy] [name of copyright owner]
|
| 190 |
+
|
| 191 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
| 192 |
+
you may not use this file except in compliance with the License.
|
| 193 |
+
You may obtain a copy of the License at
|
| 194 |
+
|
| 195 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
| 196 |
+
|
| 197 |
+
Unless required by applicable law or agreed to in writing, software
|
| 198 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
| 199 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 200 |
+
See the License for the specific language governing permissions and
|
| 201 |
+
limitations under the License.
|
MANIFEST.in
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
include LICENSE requirements.txt
|
Makefile
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
.PHONY: build commit license quality style test
|
| 2 |
+
|
| 3 |
+
check_dirs := scripts src tests tests_v1 setup.py
|
| 4 |
+
|
| 5 |
+
build:
|
| 6 |
+
pip3 install build && python3 -m build
|
| 7 |
+
|
| 8 |
+
commit:
|
| 9 |
+
pre-commit install
|
| 10 |
+
pre-commit run --all-files
|
| 11 |
+
|
| 12 |
+
license:
|
| 13 |
+
python3 tests/check_license.py $(check_dirs)
|
| 14 |
+
|
| 15 |
+
quality:
|
| 16 |
+
ruff check $(check_dirs)
|
| 17 |
+
ruff format --check $(check_dirs)
|
| 18 |
+
|
| 19 |
+
style:
|
| 20 |
+
ruff check $(check_dirs) --fix
|
| 21 |
+
ruff format $(check_dirs)
|
| 22 |
+
|
| 23 |
+
test:
|
| 24 |
+
CUDA_VISIBLE_DEVICES= WANDB_DISABLED=true pytest -vv tests/
|
README.md
ADDED
|
@@ -0,0 +1,973 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+

|
| 2 |
+
|
| 3 |
+
[](https://github.com/hiyouga/LLaMA-Factory/stargazers)
|
| 4 |
+
[](https://github.com/hiyouga/LLaMA-Factory/commits/main)
|
| 5 |
+
[](https://github.com/hiyouga/LLaMA-Factory/graphs/contributors)
|
| 6 |
+
[](https://github.com/hiyouga/LLaMA-Factory/actions/workflows/tests.yml)
|
| 7 |
+
[](https://pypi.org/project/llamafactory/)
|
| 8 |
+
[](https://scholar.google.com/scholar?cites=12620864006390196564)
|
| 9 |
+
[](https://hub.docker.com/r/hiyouga/llamafactory/tags)
|
| 10 |
+
|
| 11 |
+
[](https://twitter.com/llamafactory_ai)
|
| 12 |
+
[](https://discord.gg/rKfvV9r9FK)
|
| 13 |
+
|
| 14 |
+
[](https://colab.research.google.com/drive/1eRTPn37ltBbYsISy9Aw2NuI2Aq5CQrD9?usp=sharing)
|
| 15 |
+
[](https://gallery.pai-ml.com/#/preview/deepLearning/nlp/llama_factory)
|
| 16 |
+
[](https://www.lab4ai.cn/course/detail?id=7c13e60f6137474eb40f6fd3983c0f46&utm_source=LLaMA-Factory)
|
| 17 |
+
[](https://www.llamafactory.com.cn/?utm_source=LLaMA-Factory)
|
| 18 |
+
[](https://huggingface.co/spaces/hiyouga/LLaMA-Board)
|
| 19 |
+
[](https://modelscope.cn/studios/hiyouga/LLaMA-Board)
|
| 20 |
+
[](https://novita.ai/templates-library/105981?sharer=88115474-394e-4bda-968e-b88e123d0c47)
|
| 21 |
+
|
| 22 |
+
### Used by [Amazon](https://aws.amazon.com/cn/blogs/machine-learning/how-apoidea-group-enhances-visual-information-extraction-from-banking-documents-with-multimodal-models-using-llama-factory-on-amazon-sagemaker-hyperpod/), [NVIDIA](https://developer.nvidia.com/rtx/ai-toolkit), [Aliyun](https://help.aliyun.com/zh/pai/use-cases/fine-tune-a-llama-3-model-with-llama-factory), etc.
|
| 23 |
+
|
| 24 |
+
<div align="center" markdown="1">
|
| 25 |
+
|
| 26 |
+
### Supporters ❤️
|
| 27 |
+
|
| 28 |
+
| <div style="text-align: center;"><a href="https://warp.dev/llama-factory"><img alt="Warp sponsorship" width="400" src="assets/sponsors/warp.jpg"></a><br><a href="https://warp.dev/llama-factory" style="font-size:larger;">Warp, the agentic terminal for developers</a><br><a href="https://warp.dev/llama-factory">Available for MacOS, Linux, & Windows</a> | <a href="https://serpapi.com"><img alt="SerpAPI sponsorship" width="250" src="assets/sponsors/serpapi.svg"> </a> |
|
| 29 |
+
| ---- | ---- |
|
| 30 |
+
|
| 31 |
+
----
|
| 32 |
+
|
| 33 |
+
### Easily fine-tune 100+ large language models with zero-code [CLI](#quickstart) and [Web UI](#fine-tuning-with-llama-board-gui-powered-by-gradio)
|
| 34 |
+
|
| 35 |
+

|
| 36 |
+
|
| 37 |
+
</div>
|
| 38 |
+
|
| 39 |
+
👋 Join our [WeChat](https://github.com/hiyouga/llamafactory-community/blob/main/wechat/main.jpg), [NPU](https://github.com/hiyouga/llamafactory-community/blob/main/wechat/npu.jpg), [Lab4AI](https://github.com/hiyouga/llamafactory-community/blob/main/wechat/lab4ai.jpg), [LLaMA Factory Online](https://github.com/hiyouga/llamafactory-community/blob/main/wechat/online.jpg) user group.
|
| 40 |
+
|
| 41 |
+
\[ English | [中文](README_zh.md) \]
|
| 42 |
+
|
| 43 |
+
**Fine-tuning a large language model can be easy as...**
|
| 44 |
+
|
| 45 |
+
https://github.com/user-attachments/assets/3991a3a8-4276-4d30-9cab-4cb0c4b9b99e
|
| 46 |
+
|
| 47 |
+
Choose your path:
|
| 48 |
+
|
| 49 |
+
- **Documentation (WIP)**: https://llamafactory.readthedocs.io/en/latest/
|
| 50 |
+
- **Documentation (AMD GPU)**: https://rocm.docs.amd.com/projects/ai-developer-hub/en/latest/notebooks/fine_tune/llama_factory_llama3.html
|
| 51 |
+
- **Colab (free)**: https://colab.research.google.com/drive/1eRTPn37ltBbYsISy9Aw2NuI2Aq5CQrD9?usp=sharing
|
| 52 |
+
- **Local machine**: Please refer to [usage](#getting-started)
|
| 53 |
+
- **PAI-DSW (free trial)**: https://gallery.pai-ml.com/#/preview/deepLearning/nlp/llama_factory
|
| 54 |
+
- **Alaya NeW (cloud GPU deal)**: https://docs.alayanew.com/docs/documents/useGuide/LLaMAFactory/mutiple/?utm_source=LLaMA-Factory
|
| 55 |
+
- **Official Course**: https://www.lab4ai.cn/course/detail?id=7c13e60f6137474eb40f6fd3983c0f46&utm_source=LLaMA-Factory
|
| 56 |
+
- **LLaMA Factory Online**: https://www.llamafactory.com.cn/?utm_source=LLaMA-Factory
|
| 57 |
+
|
| 58 |
+
> [!NOTE]
|
| 59 |
+
> Except for the above links, all other websites are unauthorized third-party websites. Please carefully use them.
|
| 60 |
+
|
| 61 |
+
## Table of Contents
|
| 62 |
+
|
| 63 |
+
- [Features](#features)
|
| 64 |
+
- [Blogs](#blogs)
|
| 65 |
+
- [Changelog](#changelog)
|
| 66 |
+
- [Supported Models](#supported-models)
|
| 67 |
+
- [Supported Training Approaches](#supported-training-approaches)
|
| 68 |
+
- [Provided Datasets](#provided-datasets)
|
| 69 |
+
- [Requirement](#requirement)
|
| 70 |
+
- [Getting Started](#getting-started)
|
| 71 |
+
- [Installation](#installation)
|
| 72 |
+
- [Data Preparation](#data-preparation)
|
| 73 |
+
- [Quickstart](#quickstart)
|
| 74 |
+
- [Fine-Tuning with LLaMA Board GUI](#fine-tuning-with-llama-board-gui-powered-by-gradio)
|
| 75 |
+
- [LLaMA Factory Online](#llama-factory-online)
|
| 76 |
+
- [Build Docker](#build-docker)
|
| 77 |
+
- [Deploy with OpenAI-style API and vLLM](#deploy-with-openai-style-api-and-vllm)
|
| 78 |
+
- [Download from ModelScope Hub](#download-from-modelscope-hub)
|
| 79 |
+
- [Download from Modelers Hub](#download-from-modelers-hub)
|
| 80 |
+
- [Use W&B Logger](#use-wb-logger)
|
| 81 |
+
- [Use SwanLab Logger](#use-swanlab-logger)
|
| 82 |
+
- [Projects using LLaMA Factory](#projects-using-llama-factory)
|
| 83 |
+
- [License](#license)
|
| 84 |
+
- [Citation](#citation)
|
| 85 |
+
- [Acknowledgement](#acknowledgement)
|
| 86 |
+
|
| 87 |
+
## Features
|
| 88 |
+
|
| 89 |
+
- **Various models**: LLaMA, LLaVA, Mistral, Mixtral-MoE, Qwen, Qwen2-VL, DeepSeek, Yi, Gemma, ChatGLM, Phi, etc.
|
| 90 |
+
- **Integrated methods**: (Continuous) pre-training, (multimodal) supervised fine-tuning, reward modeling, PPO, DPO, KTO, ORPO, etc.
|
| 91 |
+
- **Scalable resources**: 16-bit full-tuning, freeze-tuning, LoRA and 2/3/4/5/6/8-bit QLoRA via AQLM/AWQ/GPTQ/LLM.int8/HQQ/EETQ.
|
| 92 |
+
- **Advanced algorithms**: [GaLore](https://github.com/jiaweizzhao/GaLore), [BAdam](https://github.com/Ledzy/BAdam), [APOLLO](https://github.com/zhuhanqing/APOLLO), [Adam-mini](https://github.com/zyushun/Adam-mini), [Muon](https://github.com/KellerJordan/Muon), [OFT](https://github.com/huggingface/peft/tree/main/src/peft/tuners/oft), DoRA, LongLoRA, LLaMA Pro, Mixture-of-Depths, LoRA+, LoftQ and PiSSA.
|
| 93 |
+
- **Practical tricks**: [FlashAttention-2](https://github.com/Dao-AILab/flash-attention), [Unsloth](https://github.com/unslothai/unsloth), [Liger Kernel](https://github.com/linkedin/Liger-Kernel), RoPE scaling, NEFTune and rsLoRA.
|
| 94 |
+
- **Wide tasks**: Multi-turn dialogue, tool using, image understanding, visual grounding, video recognition, audio understanding, etc.
|
| 95 |
+
- **Experiment monitors**: LlamaBoard, TensorBoard, Wandb, MLflow, [SwanLab](https://github.com/SwanHubX/SwanLab), etc.
|
| 96 |
+
- **Faster inference**: OpenAI-style API, Gradio UI and CLI with [vLLM worker](https://github.com/vllm-project/vllm) or [SGLang worker](https://github.com/sgl-project/sglang).
|
| 97 |
+
|
| 98 |
+
### Day-N Support for Fine-Tuning Cutting-Edge Models
|
| 99 |
+
|
| 100 |
+
| Support Date | Model Name |
|
| 101 |
+
| ------------ | -------------------------------------------------------------------- |
|
| 102 |
+
| Day 0 | Qwen3 / Qwen2.5-VL / Gemma 3 / GLM-4.1V / InternLM 3 / MiniCPM-o-2.6 |
|
| 103 |
+
| Day 1 | Llama 3 / GLM-4 / Mistral Small / PaliGemma2 / Llama 4 |
|
| 104 |
+
|
| 105 |
+
## Blogs
|
| 106 |
+
|
| 107 |
+
- 💡 [Easy Dataset × LLaMA Factory: Enabling LLMs to Efficiently Learn Domain Knowledge](https://buaa-act.feishu.cn/wiki/GVzlwYcRFiR8OLkHbL6cQpYin7g) (English)
|
| 108 |
+
- [Fine-tune a mental health LLM using LLaMA-Factory](https://www.lab4ai.cn/project/detail?id=25cce32ec131497b9e06a93336a0817f&type=project&utm_source=LLaMA-Factory) (Chinese)
|
| 109 |
+
- [Fine-tune GPT-OSS for Role-Playing using LLaMA-Factory](https://docs.llamafactory.com.cn/docs/documents/best-practice/gptroleplay/?utm_source=LLaMA-Factory) (Chinese)
|
| 110 |
+
- [A One-Stop Code-Free Model Reinforcement Learning and Deployment Platform based on LLaMA-Factory and EasyR1](https://aws.amazon.com/cn/blogs/china/building-llm-model-hub-based-on-llamafactory-and-easyr1/) (Chinese)
|
| 111 |
+
- [How Apoidea Group enhances visual information extraction from banking documents with multimodal models using LLaMA-Factory on Amazon SageMaker HyperPod](https://aws.amazon.com/cn/blogs/machine-learning/how-apoidea-group-enhances-visual-information-extraction-from-banking-documents-with-multimodal-models-using-llama-factory-on-amazon-sagemaker-hyperpod/) (English)
|
| 112 |
+
|
| 113 |
+
<details><summary>All Blogs</summary>
|
| 114 |
+
|
| 115 |
+
- [Fine-tune Llama3.1-70B for Medical Diagnosis using LLaMA-Factory](https://docs.alayanew.com/docs/documents/bestPractice/bigModel/llama70B/?utm_source=LLaMA-Factory) (Chinese)
|
| 116 |
+
- [Fine-tune Qwen2.5-VL for Autonomous Driving using LLaMA-Factory](https://docs.alayanew.com/docs/documents/useGuide/LLaMAFactory/mutiple/?utm_source=LLaMA-Factory) (Chinese)
|
| 117 |
+
- [LLaMA Factory: Fine-tuning the DeepSeek-R1-Distill-Qwen-7B Model for News Classifier](https://gallery.pai-ml.com/#/preview/deepLearning/nlp/llama_factory_deepseek_r1_distill_7b) (Chinese)
|
| 118 |
+
- [A One-Stop Code-Free Model Fine-Tuning \& Deployment Platform based on SageMaker and LLaMA-Factory](https://aws.amazon.com/cn/blogs/china/a-one-stop-code-free-model-fine-tuning-deployment-platform-based-on-sagemaker-and-llama-factory/) (Chinese)
|
| 119 |
+
- [LLaMA Factory Multi-Modal Fine-Tuning Practice: Fine-Tuning Qwen2-VL for Personal Tourist Guide](https://gallery.pai-ml.com/#/preview/deepLearning/nlp/llama_factory_qwen2vl) (Chinese)
|
| 120 |
+
- [LLaMA Factory: Fine-tuning Llama3 for Role-Playing](https://gallery.pai-ml.com/#/preview/deepLearning/nlp/llama_factory) (Chinese)
|
| 121 |
+
|
| 122 |
+
</details>
|
| 123 |
+
|
| 124 |
+
## Changelog
|
| 125 |
+
|
| 126 |
+
[25/08/22] We supported **[OFT](https://arxiv.org/abs/2306.07280)** and **[OFTv2](https://arxiv.org/abs/2506.19847)**. See [examples](examples/README.md) for usage.
|
| 127 |
+
|
| 128 |
+
[25/08/20] We supported fine-tuning the **[Intern-S1-mini](https://huggingface.co/internlm/Intern-S1-mini)** models. See [PR #8976](https://github.com/hiyouga/LLaMA-Factory/pull/8976) to get started.
|
| 129 |
+
|
| 130 |
+
[25/08/06] We supported fine-tuning the **[GPT-OSS](https://github.com/openai/gpt-oss)** models. See [PR #8826](https://github.com/hiyouga/LLaMA-Factory/pull/8826) to get started.
|
| 131 |
+
|
| 132 |
+
<details><summary>Full Changelog</summary>
|
| 133 |
+
|
| 134 |
+
[25/07/02] We supported fine-tuning the **[GLM-4.1V-9B-Thinking](https://github.com/THUDM/GLM-4.1V-Thinking)** model.
|
| 135 |
+
|
| 136 |
+
[25/04/28] We supported fine-tuning the **[Qwen3](https://qwenlm.github.io/blog/qwen3/)** model family.
|
| 137 |
+
|
| 138 |
+
[25/04/21] We supported the **[Muon](https://github.com/KellerJordan/Muon)** optimizer. See [examples](examples/README.md) for usage. Thank [@tianshijing](https://github.com/tianshijing)'s PR.
|
| 139 |
+
|
| 140 |
+
[25/04/16] We supported fine-tuning the **[InternVL3](https://huggingface.co/OpenGVLab/InternVL3-8B)** model. See [PR #7258](https://github.com/hiyouga/LLaMA-Factory/pull/7258) to get started.
|
| 141 |
+
|
| 142 |
+
[25/04/14] We supported fine-tuning the **[GLM-Z1](https://huggingface.co/THUDM/GLM-Z1-9B-0414)** and **[Kimi-VL](https://huggingface.co/moonshotai/Kimi-VL-A3B-Instruct)** models.
|
| 143 |
+
|
| 144 |
+
[25/04/06] We supported fine-tuning the **[Llama 4](https://ai.meta.com/blog/llama-4-multimodal-intelligence/)** model. See [PR #7611](https://github.com/hiyouga/LLaMA-Factory/pull/7611) to get started.
|
| 145 |
+
|
| 146 |
+
[25/03/31] We supported fine-tuning the **[Qwen2.5 Omni](https://qwenlm.github.io/blog/qwen2.5-omni/)** model. See [PR #7537](https://github.com/hiyouga/LLaMA-Factory/pull/7537) to get started.
|
| 147 |
+
|
| 148 |
+
[25/03/15] We supported **[SGLang](https://github.com/sgl-project/sglang)** as inference backend. Try `infer_backend: sglang` to accelerate inference.
|
| 149 |
+
|
| 150 |
+
[25/03/12] We supported fine-tuning the **[Gemma 3](https://huggingface.co/blog/gemma3)** model.
|
| 151 |
+
|
| 152 |
+
[25/02/24] Announcing **[EasyR1](https://github.com/hiyouga/EasyR1)**, an efficient, scalable and multi-modality RL training framework for efficient GRPO training.
|
| 153 |
+
|
| 154 |
+
[25/02/11] We supported saving the **[Ollama](https://github.com/ollama/ollama)** modelfile when exporting the model checkpoints. See [examples](examples/README.md) for usage.
|
| 155 |
+
|
| 156 |
+
[25/02/05] We supported fine-tuning the **[Qwen2-Audio](Qwen/Qwen2-Audio-7B-Instruct)** and **[MiniCPM-o-2.6](https://huggingface.co/openbmb/MiniCPM-o-2_6)** on audio understanding tasks.
|
| 157 |
+
|
| 158 |
+
[25/01/31] We supported fine-tuning the **[DeepSeek-R1](https://huggingface.co/deepseek-ai/DeepSeek-R1)** and **[Qwen2.5-VL](https://huggingface.co/Qwen/Qwen2.5-VL-7B-Instruct)** models.
|
| 159 |
+
|
| 160 |
+
[25/01/15] We supported **[APOLLO](https://arxiv.org/abs/2412.05270)** optimizer. See [examples](examples/README.md) for usage.
|
| 161 |
+
|
| 162 |
+
[25/01/14] We supported fine-tuning the **[MiniCPM-o-2.6](https://huggingface.co/openbmb/MiniCPM-o-2_6)** and **[MiniCPM-V-2.6](https://huggingface.co/openbmb/MiniCPM-V-2_6)** models. Thank [@BUAADreamer](https://github.com/BUAADreamer)'s PR.
|
| 163 |
+
|
| 164 |
+
[25/01/14] We supported fine-tuning the **[InternLM 3](https://huggingface.co/collections/internlm/)** models. Thank [@hhaAndroid](https://github.com/hhaAndroid)'s PR.
|
| 165 |
+
|
| 166 |
+
[25/01/10] We supported fine-tuning the **[Phi-4](https://huggingface.co/microsoft/phi-4)** model.
|
| 167 |
+
|
| 168 |
+
[24/12/21] We supported using **[SwanLab](https://github.com/SwanHubX/SwanLab)** for experiment tracking and visualization. See [this section](#use-swanlab-logger) for details.
|
| 169 |
+
|
| 170 |
+
[24/11/27] We supported fine-tuning the **[Skywork-o1](https://huggingface.co/Skywork/Skywork-o1-Open-Llama-3.1-8B)** model and the **[OpenO1](https://huggingface.co/datasets/O1-OPEN/OpenO1-SFT)** dataset.
|
| 171 |
+
|
| 172 |
+
[24/10/09] We supported downloading pre-trained models and datasets from the **[Modelers Hub](https://modelers.cn/models)**. See [this tutorial](#download-from-modelers-hub) for usage.
|
| 173 |
+
|
| 174 |
+
[24/09/19] We supported fine-tuning the **[Qwen2.5](https://qwenlm.github.io/blog/qwen2.5/)** models.
|
| 175 |
+
|
| 176 |
+
[24/08/30] We supported fine-tuning the **[Qwen2-VL](https://qwenlm.github.io/blog/qwen2-vl/)** models. Thank [@simonJJJ](https://github.com/simonJJJ)'s PR.
|
| 177 |
+
|
| 178 |
+
[24/08/27] We supported **[Liger Kernel](https://github.com/linkedin/Liger-Kernel)**. Try `enable_liger_kernel: true` for efficient training.
|
| 179 |
+
|
| 180 |
+
[24/08/09] We supported **[Adam-mini](https://github.com/zyushun/Adam-mini)** optimizer. See [examples](examples/README.md) for usage. Thank [@relic-yuexi](https://github.com/relic-yuexi)'s PR.
|
| 181 |
+
|
| 182 |
+
[24/07/04] We supported [contamination-free packed training](https://github.com/MeetKai/functionary/tree/main/functionary/train/packing). Use `neat_packing: true` to activate it. Thank [@chuan298](https://github.com/chuan298)'s PR.
|
| 183 |
+
|
| 184 |
+
[24/06/16] We supported **[PiSSA](https://arxiv.org/abs/2404.02948)** algorithm. See [examples](examples/README.md) for usage.
|
| 185 |
+
|
| 186 |
+
[24/06/07] We supported fine-tuning the **[Qwen2](https://qwenlm.github.io/blog/qwen2/)** and **[GLM-4](https://github.com/THUDM/GLM-4)** models.
|
| 187 |
+
|
| 188 |
+
[24/05/26] We supported **[SimPO](https://arxiv.org/abs/2405.14734)** algorithm for preference learning. See [examples](examples/README.md) for usage.
|
| 189 |
+
|
| 190 |
+
[24/05/20] We supported fine-tuning the **PaliGemma** series models. Note that the PaliGemma models are pre-trained models, you need to fine-tune them with `paligemma` template for chat completion.
|
| 191 |
+
|
| 192 |
+
[24/05/18] We supported **[KTO](https://arxiv.org/abs/2402.01306)** algorithm for preference learning. See [examples](examples/README.md) for usage.
|
| 193 |
+
|
| 194 |
+
[24/05/14] We supported training and inference on the Ascend NPU devices. Check [installation](#installation) section for details.
|
| 195 |
+
|
| 196 |
+
[24/04/26] We supported fine-tuning the **LLaVA-1.5** multimodal LLMs. See [examples](examples/README.md) for usage.
|
| 197 |
+
|
| 198 |
+
[24/04/22] We provided a **[Colab notebook](https://colab.research.google.com/drive/1eRTPn37ltBbYsISy9Aw2NuI2Aq5CQrD9?usp=sharing)** for fine-tuning the Llama-3 model on a free T4 GPU. Two Llama-3-derived models fine-tuned using LLaMA Factory are available at Hugging Face, check [Llama3-8B-Chinese-Chat](https://huggingface.co/shenzhi-wang/Llama3-8B-Chinese-Chat) and [Llama3-Chinese](https://huggingface.co/zhichen/Llama3-Chinese) for details.
|
| 199 |
+
|
| 200 |
+
[24/04/21] We supported **[Mixture-of-Depths](https://arxiv.org/abs/2404.02258)** according to [AstraMindAI's implementation](https://github.com/astramind-ai/Mixture-of-depths). See [examples](examples/README.md) for usage.
|
| 201 |
+
|
| 202 |
+
[24/04/16] We supported **[BAdam](https://arxiv.org/abs/2404.02827)** optimizer. See [examples](examples/README.md) for usage.
|
| 203 |
+
|
| 204 |
+
[24/04/16] We supported **[unsloth](https://github.com/unslothai/unsloth)**'s long-sequence training (Llama-2-7B-56k within 24GB). It achieves **117%** speed and **50%** memory compared with FlashAttention-2, more benchmarks can be found in [this page](https://github.com/hiyouga/LLaMA-Factory/wiki/Performance-comparison).
|
| 205 |
+
|
| 206 |
+
[24/03/31] We supported **[ORPO](https://arxiv.org/abs/2403.07691)**. See [examples](examples/README.md) for usage.
|
| 207 |
+
|
| 208 |
+
[24/03/21] Our paper "[LlamaFactory: Unified Efficient Fine-Tuning of 100+ Language Models](https://arxiv.org/abs/2403.13372)" is available at arXiv!
|
| 209 |
+
|
| 210 |
+
[24/03/20] We supported **FSDP+QLoRA** that fine-tunes a 70B model on 2x24GB GPUs. See [examples](examples/README.md) for usage.
|
| 211 |
+
|
| 212 |
+
[24/03/13] We supported **[LoRA+](https://arxiv.org/abs/2402.12354)**. See [examples](examples/README.md) for usage.
|
| 213 |
+
|
| 214 |
+
[24/03/07] We supported **[GaLore](https://arxiv.org/abs/2403.03507)** optimizer. See [examples](examples/README.md) for usage.
|
| 215 |
+
|
| 216 |
+
[24/03/07] We integrated **[vLLM](https://github.com/vllm-project/vllm)** for faster and concurrent inference. Try `infer_backend: vllm` to enjoy **270%** inference speed.
|
| 217 |
+
|
| 218 |
+
[24/02/28] We supported weight-decomposed LoRA (**[DoRA](https://arxiv.org/abs/2402.09353)**). Try `use_dora: true` to activate DoRA training.
|
| 219 |
+
|
| 220 |
+
[24/02/15] We supported **block expansion** proposed by [LLaMA Pro](https://github.com/TencentARC/LLaMA-Pro). See [examples](examples/README.md) for usage.
|
| 221 |
+
|
| 222 |
+
[24/02/05] Qwen1.5 (Qwen2 beta version) series models are supported in LLaMA-Factory. Check this [blog post](https://qwenlm.github.io/blog/qwen1.5/) for details.
|
| 223 |
+
|
| 224 |
+
[24/01/18] We supported **agent tuning** for most models, equipping model with tool using abilities by fine-tuning with `dataset: glaive_toolcall_en`.
|
| 225 |
+
|
| 226 |
+
[23/12/23] We supported **[unsloth](https://github.com/unslothai/unsloth)**'s implementation to boost LoRA tuning for the LLaMA, Mistral and Yi models. Try `use_unsloth: true` argument to activate unsloth patch. It achieves **170%** speed in our benchmark, check [this page](https://github.com/hiyouga/LLaMA-Factory/wiki/Performance-comparison) for details.
|
| 227 |
+
|
| 228 |
+
[23/12/12] We supported fine-tuning the latest MoE model **[Mixtral 8x7B](https://huggingface.co/mistralai/Mixtral-8x7B-v0.1)** in our framework. See hardware requirement [here](#hardware-requirement).
|
| 229 |
+
|
| 230 |
+
[23/12/01] We supported downloading pre-trained models and datasets from the **[ModelScope Hub](https://modelscope.cn/models)**. See [this tutorial](#download-from-modelscope-hub) for usage.
|
| 231 |
+
|
| 232 |
+
[23/10/21] We supported **[NEFTune](https://arxiv.org/abs/2310.05914)** trick for fine-tuning. Try `neftune_noise_alpha: 5` argument to activate NEFTune.
|
| 233 |
+
|
| 234 |
+
[23/09/27] We supported **$S^2$-Attn** proposed by [LongLoRA](https://github.com/dvlab-research/LongLoRA) for the LLaMA models. Try `shift_attn: true` argument to enable shift short attention.
|
| 235 |
+
|
| 236 |
+
[23/09/23] We integrated MMLU, C-Eval and CMMLU benchmarks in this repo. See [examples](examples/README.md) for usage.
|
| 237 |
+
|
| 238 |
+
[23/09/10] We supported **[FlashAttention-2](https://github.com/Dao-AILab/flash-attention)**. Try `flash_attn: fa2` argument to enable FlashAttention-2 if you are using RTX4090, A100 or H100 GPUs.
|
| 239 |
+
|
| 240 |
+
[23/08/12] We supported **RoPE scaling** to extend the context length of the LLaMA models. Try `rope_scaling: linear` argument in training and `rope_scaling: dynamic` argument at inference to extrapolate the position embeddings.
|
| 241 |
+
|
| 242 |
+
[23/08/11] We supported **[DPO training](https://arxiv.org/abs/2305.18290)** for instruction-tuned models. See [examples](examples/README.md) for usage.
|
| 243 |
+
|
| 244 |
+
[23/07/31] We supported **dataset streaming**. Try `streaming: true` and `max_steps: 10000` arguments to load your dataset in streaming mode.
|
| 245 |
+
|
| 246 |
+
[23/07/29] We released two instruction-tuned 13B models at Hugging Face. See these Hugging Face Repos ([LLaMA-2](https://huggingface.co/hiyouga/Llama-2-Chinese-13b-chat) / [Baichuan](https://huggingface.co/hiyouga/Baichuan-13B-sft)) for details.
|
| 247 |
+
|
| 248 |
+
[23/07/18] We developed an **all-in-one Web UI** for training, evaluation and inference. Try `train_web.py` to fine-tune models in your Web browser. Thank [@KanadeSiina](https://github.com/KanadeSiina) and [@codemayq](https://github.com/codemayq) for their efforts in the development.
|
| 249 |
+
|
| 250 |
+
[23/07/09] We released **[FastEdit](https://github.com/hiyouga/FastEdit)** ⚡🩹, an easy-to-use package for editing the factual knowledge of large language models efficiently. Please follow [FastEdit](https://github.com/hiyouga/FastEdit) if you are interested.
|
| 251 |
+
|
| 252 |
+
[23/06/29] We provided a **reproducible example** of training a chat model using instruction-following datasets, see [Baichuan-7B-sft](https://huggingface.co/hiyouga/Baichuan-7B-sft) for details.
|
| 253 |
+
|
| 254 |
+
[23/06/22] We aligned the [demo API](src/api_demo.py) with the [OpenAI's](https://platform.openai.com/docs/api-reference/chat) format where you can insert the fine-tuned model in **arbitrary ChatGPT-based applications**.
|
| 255 |
+
|
| 256 |
+
[23/06/03] We supported quantized training and inference (aka **[QLoRA](https://github.com/artidoro/qlora)**). See [examples](examples/README.md) for usage.
|
| 257 |
+
|
| 258 |
+
</details>
|
| 259 |
+
|
| 260 |
+
> [!TIP]
|
| 261 |
+
> If you cannot use the latest feature, please pull the latest code and install LLaMA-Factory again.
|
| 262 |
+
|
| 263 |
+
## Supported Models
|
| 264 |
+
|
| 265 |
+
| Model | Model size | Template |
|
| 266 |
+
| ----------------------------------------------------------------- | -------------------------------- | -------------------- |
|
| 267 |
+
| [Baichuan 2](https://huggingface.co/baichuan-inc) | 7B/13B | baichuan2 |
|
| 268 |
+
| [BLOOM/BLOOMZ](https://huggingface.co/bigscience) | 560M/1.1B/1.7B/3B/7.1B/176B | - |
|
| 269 |
+
| [ChatGLM3](https://huggingface.co/THUDM) | 6B | chatglm3 |
|
| 270 |
+
| [Command R](https://huggingface.co/CohereForAI) | 35B/104B | cohere |
|
| 271 |
+
| [DeepSeek (Code/MoE)](https://huggingface.co/deepseek-ai) | 7B/16B/67B/236B | deepseek |
|
| 272 |
+
| [DeepSeek 2.5/3](https://huggingface.co/deepseek-ai) | 236B/671B | deepseek3 |
|
| 273 |
+
| [DeepSeek R1 (Distill)](https://huggingface.co/deepseek-ai) | 1.5B/7B/8B/14B/32B/70B/671B | deepseekr1 |
|
| 274 |
+
| [ERNIE-4.5](https://huggingface.co/baidu) | 0.3B/21B/300B | ernie/ernie_nothink |
|
| 275 |
+
| [Falcon](https://huggingface.co/tiiuae) | 7B/11B/40B/180B | falcon |
|
| 276 |
+
| [Falcon-H1](https://huggingface.co/tiiuae) | 0.5B/1.5B/3B/7B/34B | falcon_h1 |
|
| 277 |
+
| [Gemma/Gemma 2/CodeGemma](https://huggingface.co/google) | 2B/7B/9B/27B | gemma/gemma2 |
|
| 278 |
+
| [Gemma 3/Gemma 3n](https://huggingface.co/google) | 270M/1B/4B/6B/8B/12B/27B | gemma3/gemma3n |
|
| 279 |
+
| [GLM-4/GLM-4-0414/GLM-Z1](https://huggingface.co/zai-org) | 9B/32B | glm4/glmz1 |
|
| 280 |
+
| [GLM-4.1V](https://huggingface.co/zai-org) | 9B | glm4v |
|
| 281 |
+
| [GLM-4.5/GLM-4.5V](https://huggingface.co/zai-org) | 106B/355B | glm4_moe/glm4v_moe |
|
| 282 |
+
| [GPT-2](https://huggingface.co/openai-community) | 0.1B/0.4B/0.8B/1.5B | - |
|
| 283 |
+
| [GPT-OSS](https://huggingface.co/openai) | 20B/120B | gpt |
|
| 284 |
+
| [Granite 3.0-3.3](https://huggingface.co/ibm-granite) | 1B/2B/3B/8B | granite3 |
|
| 285 |
+
| [Granite 4](https://huggingface.co/ibm-granite) | 7B | granite4 |
|
| 286 |
+
| [Hunyuan (MT)](https://huggingface.co/tencent/) | 7B | hunyuan |
|
| 287 |
+
| [Index](https://huggingface.co/IndexTeam) | 1.9B | index |
|
| 288 |
+
| [InternLM 2-3](https://huggingface.co/internlm) | 7B/8B/20B | intern2 |
|
| 289 |
+
| [InternVL 2.5-3.5](https://huggingface.co/OpenGVLab) | 1B/2B/4B/8B/14B/30B/38B/78B/241B | intern_vl |
|
| 290 |
+
| [InternLM/Intern-S1-mini](https://huggingface.co/internlm/) | 8B | intern_s1 |
|
| 291 |
+
| [Kimi-VL](https://huggingface.co/moonshotai) | 16B | kimi_vl |
|
| 292 |
+
| [Ling 2.0 (mini/flash)](https://huggingface.co/inclusionAI) | 16B/100B | bailing_v2 |
|
| 293 |
+
| [Llama](https://github.com/facebookresearch/llama) | 7B/13B/33B/65B | - |
|
| 294 |
+
| [Llama 2](https://huggingface.co/meta-llama) | 7B/13B/70B | llama2 |
|
| 295 |
+
| [Llama 3-3.3](https://huggingface.co/meta-llama) | 1B/3B/8B/70B | llama3 |
|
| 296 |
+
| [Llama 4](https://huggingface.co/meta-llama) | 109B/402B | llama4 |
|
| 297 |
+
| [Llama 3.2 Vision](https://huggingface.co/meta-llama) | 11B/90B | mllama |
|
| 298 |
+
| [LLaVA-1.5](https://huggingface.co/llava-hf) | 7B/13B | llava |
|
| 299 |
+
| [LLaVA-NeXT](https://huggingface.co/llava-hf) | 7B/8B/13B/34B/72B/110B | llava_next |
|
| 300 |
+
| [LLaVA-NeXT-Video](https://huggingface.co/llava-hf) | 7B/34B | llava_next_video |
|
| 301 |
+
| [MiMo](https://huggingface.co/XiaomiMiMo) | 7B | mimo |
|
| 302 |
+
| [MiniCPM 1-4.1](https://huggingface.co/openbmb) | 0.5B/1B/2B/4B/8B | cpm/cpm3/cpm4 |
|
| 303 |
+
| [MiniCPM-o-2.6/MiniCPM-V-2.6](https://huggingface.co/openbmb) | 8B | minicpm_o/minicpm_v |
|
| 304 |
+
| [Ministral/Mistral-Nemo](https://huggingface.co/mistralai) | 8B/12B | ministral |
|
| 305 |
+
| [Mistral/Mixtral](https://huggingface.co/mistralai) | 7B/8x7B/8x22B | mistral |
|
| 306 |
+
| [Mistral Small](https://huggingface.co/mistralai) | 24B | mistral_small |
|
| 307 |
+
| [OLMo](https://huggingface.co/allenai) | 1B/7B | - |
|
| 308 |
+
| [PaliGemma/PaliGemma2](https://huggingface.co/google) | 3B/10B/28B | paligemma |
|
| 309 |
+
| [Phi-1.5/Phi-2](https://huggingface.co/microsoft) | 1.3B/2.7B | - |
|
| 310 |
+
| [Phi-3/Phi-3.5](https://huggingface.co/microsoft) | 4B/14B | phi |
|
| 311 |
+
| [Phi-3-small](https://huggingface.co/microsoft) | 7B | phi_small |
|
| 312 |
+
| [Phi-4](https://huggingface.co/microsoft) | 14B | phi4 |
|
| 313 |
+
| [Pixtral](https://huggingface.co/mistralai) | 12B | pixtral |
|
| 314 |
+
| [Qwen (1-2.5) (Code/Math/MoE/QwQ)](https://huggingface.co/Qwen) | 0.5B/1.5B/3B/7B/14B/32B/72B/110B | qwen |
|
| 315 |
+
| [Qwen3 (MoE/Instruct/Thinking/Next)](https://huggingface.co/Qwen) | 0.6B/1.7B/4B/8B/14B/32B/80B/235B | qwen3/qwen3_nothink |
|
| 316 |
+
| [Qwen2-Audio](https://huggingface.co/Qwen) | 7B | qwen2_audio |
|
| 317 |
+
| [Qwen2.5-Omni](https://huggingface.co/Qwen) | 3B/7B | qwen2_omni |
|
| 318 |
+
| [Qwen3-Omni](https://huggingface.co/Qwen) | 30B | qwen3_omni |
|
| 319 |
+
| [Qwen2-VL/Qwen2.5-VL/QVQ](https://huggingface.co/Qwen) | 2B/3B/7B/32B/72B | qwen2_vl |
|
| 320 |
+
| [Qwen3-VL](https://huggingface.co/Qwen) | 2B/4B/8B/30B/32B/235B | qwen3_vl |
|
| 321 |
+
| [Seed (OSS/Coder)](https://huggingface.co/ByteDance-Seed) | 8B/36B | seed_oss/seed_coder |
|
| 322 |
+
| [Skywork o1](https://huggingface.co/Skywork) | 8B | skywork_o1 |
|
| 323 |
+
| [StarCoder 2](https://huggingface.co/bigcode) | 3B/7B/15B | - |
|
| 324 |
+
| [TeleChat2](https://huggingface.co/Tele-AI) | 3B/7B/35B/115B | telechat2 |
|
| 325 |
+
| [XVERSE](https://huggingface.co/xverse) | 7B/13B/65B | xverse |
|
| 326 |
+
| [Yi/Yi-1.5 (Code)](https://huggingface.co/01-ai) | 1.5B/6B/9B/34B | yi |
|
| 327 |
+
| [Yi-VL](https://huggingface.co/01-ai) | 6B/34B | yi_vl |
|
| 328 |
+
| [Yuan 2](https://huggingface.co/IEITYuan) | 2B/51B/102B | yuan |
|
| 329 |
+
|
| 330 |
+
> [!NOTE]
|
| 331 |
+
> For the "base" models, the `template` argument can be chosen from `default`, `alpaca`, `vicuna` etc. But make sure to use the **corresponding template** for the "instruct/chat" models.
|
| 332 |
+
>
|
| 333 |
+
> Remember to use the **SAME** template in training and inference.
|
| 334 |
+
>
|
| 335 |
+
> \*: You should install the `transformers` from main branch and use `DISABLE_VERSION_CHECK=1` to skip version check.
|
| 336 |
+
>
|
| 337 |
+
> \*\*: You need to install a specific version of `transformers` to use the corresponding model.
|
| 338 |
+
|
| 339 |
+
Please refer to [constants.py](src/llamafactory/extras/constants.py) for a full list of models we supported.
|
| 340 |
+
|
| 341 |
+
You also can add a custom chat template to [template.py](src/llamafactory/data/template.py).
|
| 342 |
+
|
| 343 |
+
## Supported Training Approaches
|
| 344 |
+
|
| 345 |
+
| Approach | Full-tuning | Freeze-tuning | LoRA | QLoRA | OFT | QOFT |
|
| 346 |
+
| ---------------------- | ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | ------------------ |
|
| 347 |
+
| Pre-Training | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|
| 348 |
+
| Supervised Fine-Tuning | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|
| 349 |
+
| Reward Modeling | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|
| 350 |
+
| PPO Training | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|
| 351 |
+
| DPO Training | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|
| 352 |
+
| KTO Training | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|
| 353 |
+
| ORPO Training | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|
| 354 |
+
| SimPO Training | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|
| 355 |
+
|
| 356 |
+
> [!TIP]
|
| 357 |
+
> The implementation details of PPO can be found in [this blog](https://newfacade.github.io/notes-on-reinforcement-learning/17-ppo-trl.html).
|
| 358 |
+
|
| 359 |
+
## Provided Datasets
|
| 360 |
+
|
| 361 |
+
<details><summary>Pre-training datasets</summary>
|
| 362 |
+
|
| 363 |
+
- [Wiki Demo (en)](data/wiki_demo.txt)
|
| 364 |
+
- [RefinedWeb (en)](https://huggingface.co/datasets/tiiuae/falcon-refinedweb)
|
| 365 |
+
- [RedPajama V2 (en)](https://huggingface.co/datasets/togethercomputer/RedPajama-Data-V2)
|
| 366 |
+
- [Wikipedia (en)](https://huggingface.co/datasets/olm/olm-wikipedia-20221220)
|
| 367 |
+
- [Wikipedia (zh)](https://huggingface.co/datasets/pleisto/wikipedia-cn-20230720-filtered)
|
| 368 |
+
- [Pile (en)](https://huggingface.co/datasets/EleutherAI/pile)
|
| 369 |
+
- [SkyPile (zh)](https://huggingface.co/datasets/Skywork/SkyPile-150B)
|
| 370 |
+
- [FineWeb (en)](https://huggingface.co/datasets/HuggingFaceFW/fineweb)
|
| 371 |
+
- [FineWeb-Edu (en)](https://huggingface.co/datasets/HuggingFaceFW/fineweb-edu)
|
| 372 |
+
- [CCI3-HQ (zh)](https://huggingface.co/datasets/BAAI/CCI3-HQ)
|
| 373 |
+
- [CCI3-Data (zh)](https://huggingface.co/datasets/BAAI/CCI3-Data)
|
| 374 |
+
- [CCI4.0-M2-Base-v1 (en&zh)](https://huggingface.co/datasets/BAAI/CCI4.0-M2-Base-v1)
|
| 375 |
+
- [CCI4.0-M2-CoT-v1 (en&zh)](https://huggingface.co/datasets/BAAI/CCI4.0-M2-CoT-v1)
|
| 376 |
+
- [CCI4.0-M2-Extra-v1 (en&zh)](https://huggingface.co/datasets/BAAI/CCI4.0-M2-Extra-v1)
|
| 377 |
+
- [The Stack (en)](https://huggingface.co/datasets/bigcode/the-stack)
|
| 378 |
+
- [StarCoder (en)](https://huggingface.co/datasets/bigcode/starcoderdata)
|
| 379 |
+
|
| 380 |
+
</details>
|
| 381 |
+
|
| 382 |
+
<details><summary>Supervised fine-tuning datasets</summary>
|
| 383 |
+
|
| 384 |
+
- [Identity (en&zh)](data/identity.json)
|
| 385 |
+
- [Stanford Alpaca (en)](https://github.com/tatsu-lab/stanford_alpaca)
|
| 386 |
+
- [Stanford Alpaca (zh)](https://github.com/ymcui/Chinese-LLaMA-Alpaca-3)
|
| 387 |
+
- [Alpaca GPT4 (en&zh)](https://github.com/Instruction-Tuning-with-GPT-4/GPT-4-LLM)
|
| 388 |
+
- [Glaive Function Calling V2 (en&zh)](https://huggingface.co/datasets/glaiveai/glaive-function-calling-v2)
|
| 389 |
+
- [LIMA (en)](https://huggingface.co/datasets/GAIR/lima)
|
| 390 |
+
- [Guanaco Dataset (multilingual)](https://huggingface.co/datasets/JosephusCheung/GuanacoDataset)
|
| 391 |
+
- [BELLE 2M (zh)](https://huggingface.co/datasets/BelleGroup/train_2M_CN)
|
| 392 |
+
- [BELLE 1M (zh)](https://huggingface.co/datasets/BelleGroup/train_1M_CN)
|
| 393 |
+
- [BELLE 0.5M (zh)](https://huggingface.co/datasets/BelleGroup/train_0.5M_CN)
|
| 394 |
+
- [BELLE Dialogue 0.4M (zh)](https://huggingface.co/datasets/BelleGroup/generated_chat_0.4M)
|
| 395 |
+
- [BELLE School Math 0.25M (zh)](https://huggingface.co/datasets/BelleGroup/school_math_0.25M)
|
| 396 |
+
- [BELLE Multiturn Chat 0.8M (zh)](https://huggingface.co/datasets/BelleGroup/multiturn_chat_0.8M)
|
| 397 |
+
- [UltraChat (en)](https://github.com/thunlp/UltraChat)
|
| 398 |
+
- [OpenPlatypus (en)](https://huggingface.co/datasets/garage-bAInd/Open-Platypus)
|
| 399 |
+
- [CodeAlpaca 20k (en)](https://huggingface.co/datasets/sahil2801/CodeAlpaca-20k)
|
| 400 |
+
- [Alpaca CoT (multilingual)](https://huggingface.co/datasets/QingyiSi/Alpaca-CoT)
|
| 401 |
+
- [OpenOrca (en)](https://huggingface.co/datasets/Open-Orca/OpenOrca)
|
| 402 |
+
- [SlimOrca (en)](https://huggingface.co/datasets/Open-Orca/SlimOrca)
|
| 403 |
+
- [MathInstruct (en)](https://huggingface.co/datasets/TIGER-Lab/MathInstruct)
|
| 404 |
+
- [Firefly 1.1M (zh)](https://huggingface.co/datasets/YeungNLP/firefly-train-1.1M)
|
| 405 |
+
- [Wiki QA (en)](https://huggingface.co/datasets/wiki_qa)
|
| 406 |
+
- [Web QA (zh)](https://huggingface.co/datasets/suolyer/webqa)
|
| 407 |
+
- [WebNovel (zh)](https://huggingface.co/datasets/zxbsmk/webnovel_cn)
|
| 408 |
+
- [Nectar (en)](https://huggingface.co/datasets/berkeley-nest/Nectar)
|
| 409 |
+
- [deepctrl (en&zh)](https://www.modelscope.cn/datasets/deepctrl/deepctrl-sft-data)
|
| 410 |
+
- [Advertise Generating (zh)](https://huggingface.co/datasets/HasturOfficial/adgen)
|
| 411 |
+
- [ShareGPT Hyperfiltered (en)](https://huggingface.co/datasets/totally-not-an-llm/sharegpt-hyperfiltered-3k)
|
| 412 |
+
- [ShareGPT4 (en&zh)](https://huggingface.co/datasets/shibing624/sharegpt_gpt4)
|
| 413 |
+
- [UltraChat 200k (en)](https://huggingface.co/datasets/HuggingFaceH4/ultrachat_200k)
|
| 414 |
+
- [Infinity Instruct (zh)](https://huggingface.co/datasets/BAAI/Infinity-Instruct)
|
| 415 |
+
- [AgentInstruct (en)](https://huggingface.co/datasets/THUDM/AgentInstruct)
|
| 416 |
+
- [LMSYS Chat 1M (en)](https://huggingface.co/datasets/lmsys/lmsys-chat-1m)
|
| 417 |
+
- [Evol Instruct V2 (en)](https://huggingface.co/datasets/WizardLM/WizardLM_evol_instruct_V2_196k)
|
| 418 |
+
- [Cosmopedia (en)](https://huggingface.co/datasets/HuggingFaceTB/cosmopedia)
|
| 419 |
+
- [STEM (zh)](https://huggingface.co/datasets/hfl/stem_zh_instruction)
|
| 420 |
+
- [Ruozhiba (zh)](https://huggingface.co/datasets/hfl/ruozhiba_gpt4_turbo)
|
| 421 |
+
- [Neo-sft (zh)](https://huggingface.co/datasets/m-a-p/neo_sft_phase2)
|
| 422 |
+
- [Magpie-Pro-300K-Filtered (en)](https://huggingface.co/datasets/Magpie-Align/Magpie-Pro-300K-Filtered)
|
| 423 |
+
- [Magpie-ultra-v0.1 (en)](https://huggingface.co/datasets/argilla/magpie-ultra-v0.1)
|
| 424 |
+
- [WebInstructSub (en)](https://huggingface.co/datasets/TIGER-Lab/WebInstructSub)
|
| 425 |
+
- [OpenO1-SFT (en&zh)](https://huggingface.co/datasets/O1-OPEN/OpenO1-SFT)
|
| 426 |
+
- [Open-Thoughts (en)](https://huggingface.co/datasets/open-thoughts/OpenThoughts-114k)
|
| 427 |
+
- [Open-R1-Math (en)](https://huggingface.co/datasets/open-r1/OpenR1-Math-220k)
|
| 428 |
+
- [Chinese-DeepSeek-R1-Distill (zh)](https://huggingface.co/datasets/Congliu/Chinese-DeepSeek-R1-Distill-data-110k-SFT)
|
| 429 |
+
- [LLaVA mixed (en&zh)](https://huggingface.co/datasets/BUAADreamer/llava-en-zh-300k)
|
| 430 |
+
- [Pokemon-gpt4o-captions (en&zh)](https://huggingface.co/datasets/jugg1024/pokemon-gpt4o-captions)
|
| 431 |
+
- [Open Assistant (de)](https://huggingface.co/datasets/mayflowergmbh/oasst_de)
|
| 432 |
+
- [Dolly 15k (de)](https://huggingface.co/datasets/mayflowergmbh/dolly-15k_de)
|
| 433 |
+
- [Alpaca GPT4 (de)](https://huggingface.co/datasets/mayflowergmbh/alpaca-gpt4_de)
|
| 434 |
+
- [OpenSchnabeltier (de)](https://huggingface.co/datasets/mayflowergmbh/openschnabeltier_de)
|
| 435 |
+
- [Evol Instruct (de)](https://huggingface.co/datasets/mayflowergmbh/evol-instruct_de)
|
| 436 |
+
- [Dolphin (de)](https://huggingface.co/datasets/mayflowergmbh/dolphin_de)
|
| 437 |
+
- [Booksum (de)](https://huggingface.co/datasets/mayflowergmbh/booksum_de)
|
| 438 |
+
- [Airoboros (de)](https://huggingface.co/datasets/mayflowergmbh/airoboros-3.0_de)
|
| 439 |
+
- [Ultrachat (de)](https://huggingface.co/datasets/mayflowergmbh/ultra-chat_de)
|
| 440 |
+
|
| 441 |
+
</details>
|
| 442 |
+
|
| 443 |
+
<details><summary>Preference datasets</summary>
|
| 444 |
+
|
| 445 |
+
- [DPO mixed (en&zh)](https://huggingface.co/datasets/hiyouga/DPO-En-Zh-20k)
|
| 446 |
+
- [UltraFeedback (en)](https://huggingface.co/datasets/HuggingFaceH4/ultrafeedback_binarized)
|
| 447 |
+
- [COIG-P (zh)](https://huggingface.co/datasets/m-a-p/COIG-P)
|
| 448 |
+
- [RLHF-V (en)](https://huggingface.co/datasets/openbmb/RLHF-V-Dataset)
|
| 449 |
+
- [VLFeedback (en)](https://huggingface.co/datasets/Zhihui/VLFeedback)
|
| 450 |
+
- [RLAIF-V (en)](https://huggingface.co/datasets/openbmb/RLAIF-V-Dataset)
|
| 451 |
+
- [Orca DPO Pairs (en)](https://huggingface.co/datasets/Intel/orca_dpo_pairs)
|
| 452 |
+
- [HH-RLHF (en)](https://huggingface.co/datasets/Anthropic/hh-rlhf)
|
| 453 |
+
- [Nectar (en)](https://huggingface.co/datasets/berkeley-nest/Nectar)
|
| 454 |
+
- [Orca DPO (de)](https://huggingface.co/datasets/mayflowergmbh/intel_orca_dpo_pairs_de)
|
| 455 |
+
- [KTO mixed (en)](https://huggingface.co/datasets/argilla/kto-mix-15k)
|
| 456 |
+
|
| 457 |
+
</details>
|
| 458 |
+
|
| 459 |
+
Some datasets require confirmation before using them, so we recommend logging in with your Hugging Face account using these commands.
|
| 460 |
+
|
| 461 |
+
```bash
|
| 462 |
+
pip install --upgrade huggingface_hub
|
| 463 |
+
huggingface-cli login
|
| 464 |
+
```
|
| 465 |
+
|
| 466 |
+
## Requirement
|
| 467 |
+
|
| 468 |
+
| Mandatory | Minimum | Recommend |
|
| 469 |
+
| ------------ | ------- | --------- |
|
| 470 |
+
| python | 3.9 | 3.10 |
|
| 471 |
+
| torch | 2.0.0 | 2.6.0 |
|
| 472 |
+
| torchvision | 0.15.0 | 0.21.0 |
|
| 473 |
+
| transformers | 4.49.0 | 4.50.0 |
|
| 474 |
+
| datasets | 2.16.0 | 3.2.0 |
|
| 475 |
+
| accelerate | 0.34.0 | 1.2.1 |
|
| 476 |
+
| peft | 0.14.0 | 0.15.1 |
|
| 477 |
+
| trl | 0.8.6 | 0.9.6 |
|
| 478 |
+
|
| 479 |
+
| Optional | Minimum | Recommend |
|
| 480 |
+
| ------------ | ------- | --------- |
|
| 481 |
+
| CUDA | 11.6 | 12.2 |
|
| 482 |
+
| deepspeed | 0.10.0 | 0.16.4 |
|
| 483 |
+
| bitsandbytes | 0.39.0 | 0.43.1 |
|
| 484 |
+
| vllm | 0.4.3 | 0.8.2 |
|
| 485 |
+
| flash-attn | 2.5.6 | 2.7.2 |
|
| 486 |
+
|
| 487 |
+
### Hardware Requirement
|
| 488 |
+
|
| 489 |
+
\* *estimated*
|
| 490 |
+
|
| 491 |
+
| Method | Bits | 7B | 14B | 30B | 70B | `x`B |
|
| 492 |
+
| ----------------------------------- | ---- | ----- | ----- | ----- | ------ | ------- |
|
| 493 |
+
| Full (`bf16` or `fp16`) | 32 | 120GB | 240GB | 600GB | 1200GB | `18x`GB |
|
| 494 |
+
| Full (`pure_bf16`) | 16 | 60GB | 120GB | 300GB | 600GB | `8x`GB |
|
| 495 |
+
| Freeze/LoRA/GaLore/APOLLO/BAdam/OFT | 16 | 16GB | 32GB | 64GB | 160GB | `2x`GB |
|
| 496 |
+
| QLoRA / QOFT | 8 | 10GB | 20GB | 40GB | 80GB | `x`GB |
|
| 497 |
+
| QLoRA / QOFT | 4 | 6GB | 12GB | 24GB | 48GB | `x/2`GB |
|
| 498 |
+
| QLoRA / QOFT | 2 | 4GB | 8GB | 16GB | 24GB | `x/4`GB |
|
| 499 |
+
|
| 500 |
+
## Getting Started
|
| 501 |
+
|
| 502 |
+
### Installation
|
| 503 |
+
|
| 504 |
+
> [!IMPORTANT]
|
| 505 |
+
> Installation is mandatory.
|
| 506 |
+
|
| 507 |
+
#### Install from Source
|
| 508 |
+
|
| 509 |
+
```bash
|
| 510 |
+
git clone --depth 1 https://github.com/hiyouga/LLaMA-Factory.git
|
| 511 |
+
cd LLaMA-Factory
|
| 512 |
+
pip install -e ".[torch,metrics]" --no-build-isolation
|
| 513 |
+
```
|
| 514 |
+
|
| 515 |
+
Extra dependencies available: torch, torch-npu, metrics, deepspeed, liger-kernel, bitsandbytes, hqq, eetq, gptq, aqlm, vllm, sglang, galore, apollo, badam, adam-mini, qwen, minicpm_v, openmind, swanlab, dev
|
| 516 |
+
|
| 517 |
+
#### Install from Docker Image
|
| 518 |
+
|
| 519 |
+
```bash
|
| 520 |
+
docker run -it --rm --gpus=all --ipc=host hiyouga/llamafactory:latest
|
| 521 |
+
```
|
| 522 |
+
|
| 523 |
+
This image is built on Ubuntu 22.04 (x86\_64), CUDA 12.4, Python 3.11, PyTorch 2.6.0, and Flash-attn 2.7.4.
|
| 524 |
+
|
| 525 |
+
Find the pre-built images: https://hub.docker.com/r/hiyouga/llamafactory/tags
|
| 526 |
+
|
| 527 |
+
Please refer to [build docker](#build-docker) to build the image yourself.
|
| 528 |
+
|
| 529 |
+
<details><summary>Setting up a virtual environment with <b>uv</b></summary>
|
| 530 |
+
|
| 531 |
+
Create an isolated Python environment with [uv](https://github.com/astral-sh/uv):
|
| 532 |
+
|
| 533 |
+
```bash
|
| 534 |
+
uv sync --extra torch --extra metrics --prerelease=allow
|
| 535 |
+
```
|
| 536 |
+
|
| 537 |
+
Run LLaMA-Factory in the isolated environment:
|
| 538 |
+
|
| 539 |
+
```bash
|
| 540 |
+
uv run --prerelease=allow llamafactory-cli train examples/train_lora/llama3_lora_pretrain.yaml
|
| 541 |
+
```
|
| 542 |
+
|
| 543 |
+
</details>
|
| 544 |
+
|
| 545 |
+
<details><summary>For Windows users</summary>
|
| 546 |
+
|
| 547 |
+
#### Install PyTorch
|
| 548 |
+
|
| 549 |
+
You need to manually install the GPU version of PyTorch on the Windows platform. Please refer to the [official website](https://pytorch.org/get-started/locally/) and the following command to install PyTorch with CUDA support:
|
| 550 |
+
|
| 551 |
+
```bash
|
| 552 |
+
pip uninstall torch torchvision torchaudio
|
| 553 |
+
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu126
|
| 554 |
+
python -c "import torch; print(torch.cuda.is_available())"
|
| 555 |
+
```
|
| 556 |
+
|
| 557 |
+
If you see `True` then you have successfully installed PyTorch with CUDA support.
|
| 558 |
+
|
| 559 |
+
Try `dataloader_num_workers: 0` if you encounter `Can't pickle local object` error.
|
| 560 |
+
|
| 561 |
+
#### Install BitsAndBytes
|
| 562 |
+
|
| 563 |
+
If you want to enable the quantized LoRA (QLoRA) on the Windows platform, you need to install a pre-built version of `bitsandbytes` library, which supports CUDA 11.1 to 12.2, please select the appropriate [release version](https://github.com/jllllll/bitsandbytes-windows-webui/releases/tag/wheels) based on your CUDA version.
|
| 564 |
+
|
| 565 |
+
```bash
|
| 566 |
+
pip install https://github.com/jllllll/bitsandbytes-windows-webui/releases/download/wheels/bitsandbytes-0.41.2.post2-py3-none-win_amd64.whl
|
| 567 |
+
```
|
| 568 |
+
|
| 569 |
+
#### Install Flash Attention-2
|
| 570 |
+
|
| 571 |
+
To enable FlashAttention-2 on the Windows platform, please use the script from [flash-attention-windows-wheel](https://huggingface.co/lldacing/flash-attention-windows-wheel) to compile and install it by yourself.
|
| 572 |
+
|
| 573 |
+
</details>
|
| 574 |
+
|
| 575 |
+
<details><summary>For Ascend NPU users</summary>
|
| 576 |
+
|
| 577 |
+
To install LLaMA Factory on Ascend NPU devices, please upgrade Python to version 3.10 or higher and specify extra dependencies: `pip install -e ".[torch-npu,metrics]"`. Additionally, you need to install the **[Ascend CANN Toolkit and Kernels](https://www.hiascend.com/developer/download/community/result?module=cann)**. Please follow the [installation tutorial](https://www.hiascend.com/document/detail/en/CANNCommunityEdition/600alphaX/softwareinstall/instg/atlasdeploy_03_0031.html) or use the following commands:
|
| 578 |
+
|
| 579 |
+
```bash
|
| 580 |
+
# replace the url according to your CANN version and devices
|
| 581 |
+
# install CANN Toolkit
|
| 582 |
+
wget https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Milan-ASL/Milan-ASL%20V100R001C20SPC702/Ascend-cann-toolkit_8.0.0.alpha002_linux-"$(uname -i)".run
|
| 583 |
+
bash Ascend-cann-toolkit_8.0.0.alpha002_linux-"$(uname -i)".run --install
|
| 584 |
+
|
| 585 |
+
# install CANN Kernels
|
| 586 |
+
wget https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Milan-ASL/Milan-ASL%20V100R001C20SPC702/Ascend-cann-kernels-910b_8.0.0.alpha002_linux-"$(uname -i)".run
|
| 587 |
+
bash Ascend-cann-kernels-910b_8.0.0.alpha002_linux-"$(uname -i)".run --install
|
| 588 |
+
|
| 589 |
+
# set env variables
|
| 590 |
+
source /usr/local/Ascend/ascend-toolkit/set_env.sh
|
| 591 |
+
```
|
| 592 |
+
|
| 593 |
+
| Requirement | Minimum | Recommend |
|
| 594 |
+
| ------------ | ------- | -------------- |
|
| 595 |
+
| CANN | 8.0.RC1 | 8.0.0.alpha002 |
|
| 596 |
+
| torch | 2.1.0 | 2.4.0 |
|
| 597 |
+
| torch-npu | 2.1.0 | 2.4.0.post2 |
|
| 598 |
+
| deepspeed | 0.13.2 | 0.13.2 |
|
| 599 |
+
| vllm-ascend | - | 0.7.3 |
|
| 600 |
+
|
| 601 |
+
Remember to use `ASCEND_RT_VISIBLE_DEVICES` instead of `CUDA_VISIBLE_DEVICES` to specify the device to use.
|
| 602 |
+
|
| 603 |
+
If you cannot infer model on NPU devices, try setting `do_sample: false` in the configurations.
|
| 604 |
+
|
| 605 |
+
Download the pre-built Docker images: [32GB](http://mirrors.cn-central-221.ovaijisuan.com/detail/130.html) | [64GB](http://mirrors.cn-central-221.ovaijisuan.com/detail/131.html)
|
| 606 |
+
|
| 607 |
+
#### Install BitsAndBytes
|
| 608 |
+
|
| 609 |
+
To use QLoRA based on bitsandbytes on Ascend NPU, please follow these 3 steps:
|
| 610 |
+
|
| 611 |
+
1. Manually compile bitsandbytes: Refer to [the installation documentation](https://huggingface.co/docs/bitsandbytes/installation?backend=Ascend+NPU&platform=Ascend+NPU) for the NPU version of bitsandbytes to complete the compilation and installation. The compilation requires a cmake version of at least 3.22.1 and a g++ version of at least 12.x.
|
| 612 |
+
|
| 613 |
+
```bash
|
| 614 |
+
# Install bitsandbytes from source
|
| 615 |
+
# Clone bitsandbytes repo, Ascend NPU backend is currently enabled on multi-backend-refactor branch
|
| 616 |
+
git clone -b multi-backend-refactor https://github.com/bitsandbytes-foundation/bitsandbytes.git
|
| 617 |
+
cd bitsandbytes/
|
| 618 |
+
|
| 619 |
+
# Install dependencies
|
| 620 |
+
pip install -r requirements-dev.txt
|
| 621 |
+
|
| 622 |
+
# Install the dependencies for the compilation tools. Note that the commands for this step may vary depending on the operating system. The following are provided for reference
|
| 623 |
+
apt-get install -y build-essential cmake
|
| 624 |
+
|
| 625 |
+
# Compile & install
|
| 626 |
+
cmake -DCOMPUTE_BACKEND=npu -S .
|
| 627 |
+
make
|
| 628 |
+
pip install .
|
| 629 |
+
```
|
| 630 |
+
|
| 631 |
+
2. Install transformers from the main branch.
|
| 632 |
+
|
| 633 |
+
```bash
|
| 634 |
+
git clone -b main https://github.com/huggingface/transformers.git
|
| 635 |
+
cd transformers
|
| 636 |
+
pip install .
|
| 637 |
+
```
|
| 638 |
+
|
| 639 |
+
3. Set `double_quantization: false` in the configuration. You can refer to the [example](examples/train_qlora/llama3_lora_sft_bnb_npu.yaml).
|
| 640 |
+
|
| 641 |
+
</details>
|
| 642 |
+
|
| 643 |
+
### Data Preparation
|
| 644 |
+
|
| 645 |
+
Please refer to [data/README.md](data/README.md) for checking the details about the format of dataset files. You can use datasets on HuggingFace / ModelScope / Modelers hub, load the dataset in local disk, or specify a path to s3/gcs cloud storage.
|
| 646 |
+
|
| 647 |
+
> [!NOTE]
|
| 648 |
+
> Please update `data/dataset_info.json` to use your custom dataset.
|
| 649 |
+
|
| 650 |
+
You can also use **[Easy Dataset](https://github.com/ConardLi/easy-dataset)**, **[DataFlow](https://github.com/OpenDCAI/DataFlow)** and **[GraphGen](https://github.com/open-sciencelab/GraphGen)** to create synthetic data for fine-tuning.
|
| 651 |
+
|
| 652 |
+
### Quickstart
|
| 653 |
+
|
| 654 |
+
Use the following 3 commands to run LoRA **fine-tuning**, **inference** and **merging** of the Llama3-8B-Instruct model, respectively.
|
| 655 |
+
|
| 656 |
+
```bash
|
| 657 |
+
llamafactory-cli train examples/train_lora/llama3_lora_sft.yaml
|
| 658 |
+
llamafactory-cli chat examples/inference/llama3_lora_sft.yaml
|
| 659 |
+
llamafactory-cli export examples/merge_lora/llama3_lora_sft.yaml
|
| 660 |
+
```
|
| 661 |
+
|
| 662 |
+
See [examples/README.md](examples/README.md) for advanced usage (including distributed training).
|
| 663 |
+
|
| 664 |
+
> [!TIP]
|
| 665 |
+
> Use `llamafactory-cli help` to show help information.
|
| 666 |
+
>
|
| 667 |
+
> Read [FAQs](https://github.com/hiyouga/LLaMA-Factory/issues/4614) first if you encounter any problems.
|
| 668 |
+
|
| 669 |
+
### Fine-Tuning with LLaMA Board GUI (powered by [Gradio](https://github.com/gradio-app/gradio))
|
| 670 |
+
|
| 671 |
+
```bash
|
| 672 |
+
llamafactory-cli webui
|
| 673 |
+
```
|
| 674 |
+
|
| 675 |
+
### LLaMA Factory Online
|
| 676 |
+
|
| 677 |
+
Read our [documentation](https://docs.llamafactory.com.cn/docs/documents/quickstart/getstarted/?utm_source=LLaMA-Factory).
|
| 678 |
+
|
| 679 |
+
### Build Docker
|
| 680 |
+
|
| 681 |
+
For CUDA users:
|
| 682 |
+
|
| 683 |
+
```bash
|
| 684 |
+
cd docker/docker-cuda/
|
| 685 |
+
docker compose up -d
|
| 686 |
+
docker compose exec llamafactory bash
|
| 687 |
+
```
|
| 688 |
+
|
| 689 |
+
For Ascend NPU users:
|
| 690 |
+
|
| 691 |
+
```bash
|
| 692 |
+
cd docker/docker-npu/
|
| 693 |
+
docker compose up -d
|
| 694 |
+
docker compose exec llamafactory bash
|
| 695 |
+
```
|
| 696 |
+
|
| 697 |
+
For AMD ROCm users:
|
| 698 |
+
|
| 699 |
+
```bash
|
| 700 |
+
cd docker/docker-rocm/
|
| 701 |
+
docker compose up -d
|
| 702 |
+
docker compose exec llamafactory bash
|
| 703 |
+
```
|
| 704 |
+
|
| 705 |
+
<details><summary>Build without Docker Compose</summary>
|
| 706 |
+
|
| 707 |
+
For CUDA users:
|
| 708 |
+
|
| 709 |
+
```bash
|
| 710 |
+
docker build -f ./docker/docker-cuda/Dockerfile \
|
| 711 |
+
--build-arg PIP_INDEX=https://pypi.org/simple \
|
| 712 |
+
--build-arg EXTRAS=metrics \
|
| 713 |
+
-t llamafactory:latest .
|
| 714 |
+
|
| 715 |
+
docker run -dit --ipc=host --gpus=all \
|
| 716 |
+
-p 7860:7860 \
|
| 717 |
+
-p 8000:8000 \
|
| 718 |
+
--name llamafactory \
|
| 719 |
+
llamafactory:latest
|
| 720 |
+
|
| 721 |
+
docker exec -it llamafactory bash
|
| 722 |
+
```
|
| 723 |
+
|
| 724 |
+
For Ascend NPU users:
|
| 725 |
+
|
| 726 |
+
```bash
|
| 727 |
+
docker build -f ./docker/docker-npu/Dockerfile \
|
| 728 |
+
--build-arg PIP_INDEX=https://pypi.org/simple \
|
| 729 |
+
--build-arg EXTRAS=torch-npu,metrics \
|
| 730 |
+
-t llamafactory:latest .
|
| 731 |
+
|
| 732 |
+
docker run -dit --ipc=host \
|
| 733 |
+
-v /usr/local/dcmi:/usr/local/dcmi \
|
| 734 |
+
-v /usr/local/bin/npu-smi:/usr/local/bin/npu-smi \
|
| 735 |
+
-v /usr/local/Ascend/driver:/usr/local/Ascend/driver \
|
| 736 |
+
-v /etc/ascend_install.info:/etc/ascend_install.info \
|
| 737 |
+
-p 7860:7860 \
|
| 738 |
+
-p 8000:8000 \
|
| 739 |
+
--device /dev/davinci0 \
|
| 740 |
+
--device /dev/davinci_manager \
|
| 741 |
+
--device /dev/devmm_svm \
|
| 742 |
+
--device /dev/hisi_hdc \
|
| 743 |
+
--name llamafactory \
|
| 744 |
+
llamafactory:latest
|
| 745 |
+
|
| 746 |
+
docker exec -it llamafactory bash
|
| 747 |
+
```
|
| 748 |
+
|
| 749 |
+
For AMD ROCm users:
|
| 750 |
+
|
| 751 |
+
```bash
|
| 752 |
+
docker build -f ./docker/docker-rocm/Dockerfile \
|
| 753 |
+
--build-arg PIP_INDEX=https://pypi.org/simple \
|
| 754 |
+
--build-arg EXTRAS=metrics \
|
| 755 |
+
-t llamafactory:latest .
|
| 756 |
+
|
| 757 |
+
docker run -dit --ipc=host \
|
| 758 |
+
-p 7860:7860 \
|
| 759 |
+
-p 8000:8000 \
|
| 760 |
+
--device /dev/kfd \
|
| 761 |
+
--device /dev/dri \
|
| 762 |
+
--name llamafactory \
|
| 763 |
+
llamafactory:latest
|
| 764 |
+
|
| 765 |
+
docker exec -it llamafactory bash
|
| 766 |
+
```
|
| 767 |
+
|
| 768 |
+
</details>
|
| 769 |
+
|
| 770 |
+
<details><summary>Use Docker volumes</summary>
|
| 771 |
+
|
| 772 |
+
You can uncomment `VOLUME [ "/root/.cache/huggingface", "/app/shared_data", "/app/output" ]` in the Dockerfile to use data volumes.
|
| 773 |
+
|
| 774 |
+
When building the Docker image, use `-v ./hf_cache:/root/.cache/huggingface` argument to mount the local directory to the container. The following data volumes are available.
|
| 775 |
+
|
| 776 |
+
- `hf_cache`: Utilize Hugging Face cache on the host machine.
|
| 777 |
+
- `shared_data`: The directionary to store datasets on the host machine.
|
| 778 |
+
- `output`: Set export dir to this location so that the merged result can be accessed directly on the host machine.
|
| 779 |
+
|
| 780 |
+
</details>
|
| 781 |
+
|
| 782 |
+
### Deploy with OpenAI-style API and vLLM
|
| 783 |
+
|
| 784 |
+
```bash
|
| 785 |
+
API_PORT=8000 llamafactory-cli api examples/inference/llama3.yaml infer_backend=vllm vllm_enforce_eager=true
|
| 786 |
+
```
|
| 787 |
+
|
| 788 |
+
> [!TIP]
|
| 789 |
+
> Visit [this page](https://platform.openai.com/docs/api-reference/chat/create) for API document.
|
| 790 |
+
>
|
| 791 |
+
> Examples: [Image understanding](scripts/api_example/test_image.py) | [Function calling](scripts/api_example/test_toolcall.py)
|
| 792 |
+
|
| 793 |
+
### Download from ModelScope Hub
|
| 794 |
+
|
| 795 |
+
If you have trouble with downloading models and datasets from Hugging Face, you can use ModelScope.
|
| 796 |
+
|
| 797 |
+
```bash
|
| 798 |
+
export USE_MODELSCOPE_HUB=1 # `set USE_MODELSCOPE_HUB=1` for Windows
|
| 799 |
+
```
|
| 800 |
+
|
| 801 |
+
Train the model by specifying a model ID of the ModelScope Hub as the `model_name_or_path`. You can find a full list of model IDs at [ModelScope Hub](https://modelscope.cn/models), e.g., `LLM-Research/Meta-Llama-3-8B-Instruct`.
|
| 802 |
+
|
| 803 |
+
### Download from Modelers Hub
|
| 804 |
+
|
| 805 |
+
You can also use Modelers Hub to download models and datasets.
|
| 806 |
+
|
| 807 |
+
```bash
|
| 808 |
+
export USE_OPENMIND_HUB=1 # `set USE_OPENMIND_HUB=1` for Windows
|
| 809 |
+
```
|
| 810 |
+
|
| 811 |
+
Train the model by specifying a model ID of the Modelers Hub as the `model_name_or_path`. You can find a full list of model IDs at [Modelers Hub](https://modelers.cn/models), e.g., `TeleAI/TeleChat-7B-pt`.
|
| 812 |
+
|
| 813 |
+
### Use W&B Logger
|
| 814 |
+
|
| 815 |
+
To use [Weights & Biases](https://wandb.ai) for logging experimental results, you need to add the following arguments to yaml files.
|
| 816 |
+
|
| 817 |
+
```yaml
|
| 818 |
+
report_to: wandb
|
| 819 |
+
run_name: test_run # optional
|
| 820 |
+
```
|
| 821 |
+
|
| 822 |
+
Set `WANDB_API_KEY` to [your key](https://wandb.ai/authorize) when launching training tasks to log in with your W&B account.
|
| 823 |
+
|
| 824 |
+
### Use SwanLab Logger
|
| 825 |
+
|
| 826 |
+
To use [SwanLab](https://github.com/SwanHubX/SwanLab) for logging experimental results, you need to add the following arguments to yaml files.
|
| 827 |
+
|
| 828 |
+
```yaml
|
| 829 |
+
use_swanlab: true
|
| 830 |
+
swanlab_run_name: test_run # optional
|
| 831 |
+
```
|
| 832 |
+
|
| 833 |
+
When launching training tasks, you can log in to SwanLab in three ways:
|
| 834 |
+
|
| 835 |
+
1. Add `swanlab_api_key=<your_api_key>` to the yaml file, and set it to your [API key](https://swanlab.cn/settings).
|
| 836 |
+
2. Set the environment variable `SWANLAB_API_KEY` to your [API key](https://swanlab.cn/settings).
|
| 837 |
+
3. Use the `swanlab login` command to complete the login.
|
| 838 |
+
|
| 839 |
+
## Projects using LLaMA Factory
|
| 840 |
+
|
| 841 |
+
If you have a project that should be incorporated, please contact via email or create a pull request.
|
| 842 |
+
|
| 843 |
+
<details><summary>Click to show</summary>
|
| 844 |
+
|
| 845 |
+
1. Wang et al. ESRL: Efficient Sampling-based Reinforcement Learning for Sequence Generation. 2023. [[arxiv]](https://arxiv.org/abs/2308.02223)
|
| 846 |
+
1. Yu et al. Open, Closed, or Small Language Models for Text Classification? 2023. [[arxiv]](https://arxiv.org/abs/2308.10092)
|
| 847 |
+
1. Wang et al. UbiPhysio: Support Daily Functioning, Fitness, and Rehabilitation with Action Understanding and Feedback in Natural Language. 2023. [[arxiv]](https://arxiv.org/abs/2308.10526)
|
| 848 |
+
1. Luceri et al. Leveraging Large Language Models to Detect Influence Campaigns in Social Media. 2023. [[arxiv]](https://arxiv.org/abs/2311.07816)
|
| 849 |
+
1. Zhang et al. Alleviating Hallucinations of Large Language Models through Induced Hallucinations. 2023. [[arxiv]](https://arxiv.org/abs/2312.15710)
|
| 850 |
+
1. Wang et al. Know Your Needs Better: Towards Structured Understanding of Marketer Demands with Analogical Reasoning Augmented LLMs. KDD 2024. [[arxiv]](https://arxiv.org/abs/2401.04319)
|
| 851 |
+
1. Wang et al. CANDLE: Iterative Conceptualization and Instantiation Distillation from Large Language Models for Commonsense Reasoning. ACL 2024. [[arxiv]](https://arxiv.org/abs/2401.07286)
|
| 852 |
+
1. Choi et al. FACT-GPT: Fact-Checking Augmentation via Claim Matching with LLMs. 2024. [[arxiv]](https://arxiv.org/abs/2402.05904)
|
| 853 |
+
1. Zhang et al. AutoMathText: Autonomous Data Selection with Language Models for Mathematical Texts. 2024. [[arxiv]](https://arxiv.org/abs/2402.07625)
|
| 854 |
+
1. Lyu et al. KnowTuning: Knowledge-aware Fine-tuning for Large Language Models. 2024. [[arxiv]](https://arxiv.org/abs/2402.11176)
|
| 855 |
+
1. Yang et al. LaCo: Large Language Model Pruning via Layer Collaps. 2024. [[arxiv]](https://arxiv.org/abs/2402.11187)
|
| 856 |
+
1. Bhardwaj et al. Language Models are Homer Simpson! Safety Re-Alignment of Fine-tuned Language Models through Task Arithmetic. 2024. [[arxiv]](https://arxiv.org/abs/2402.11746)
|
| 857 |
+
1. Yang et al. Enhancing Empathetic Response Generation by Augmenting LLMs with Small-scale Empathetic Models. 2024. [[arxiv]](https://arxiv.org/abs/2402.11801)
|
| 858 |
+
1. Yi et al. Generation Meets Verification: Accelerating Large Language Model Inference with Smart Parallel Auto-Correct Decoding. ACL 2024 Findings. [[arxiv]](https://arxiv.org/abs/2402.11809)
|
| 859 |
+
1. Cao et al. Head-wise Shareable Attention for Large Language Models. 2024. [[arxiv]](https://arxiv.org/abs/2402.11819)
|
| 860 |
+
1. Zhang et al. Enhancing Multilingual Capabilities of Large Language Models through Self-Distillation from Resource-Rich Languages. 2024. [[arxiv]](https://arxiv.org/abs/2402.12204)
|
| 861 |
+
1. Kim et al. Efficient and Effective Vocabulary Expansion Towards Multilingual Large Language Models. 2024. [[arxiv]](https://arxiv.org/abs/2402.14714)
|
| 862 |
+
1. Yu et al. KIEval: A Knowledge-grounded Interactive Evaluation Framework for Large Language Models. ACL 2024. [[arxiv]](https://arxiv.org/abs/2402.15043)
|
| 863 |
+
1. Huang et al. Key-Point-Driven Data Synthesis with its Enhancement on Mathematical Reasoning. 2024. [[arxiv]](https://arxiv.org/abs/2403.02333)
|
| 864 |
+
1. Duan et al. Negating Negatives: Alignment without Human Positive Samples via Distributional Dispreference Optimization. 2024. [[arxiv]](https://arxiv.org/abs/2403.03419)
|
| 865 |
+
1. Xie and Schwertfeger. Empowering Robotics with Large Language Models: osmAG Map Comprehension with LLMs. 2024. [[arxiv]](https://arxiv.org/abs/2403.08228)
|
| 866 |
+
1. Wu et al. Large Language Models are Parallel Multilingual Learners. 2024. [[arxiv]](https://arxiv.org/abs/2403.09073)
|
| 867 |
+
1. Zhang et al. EDT: Improving Large Language Models' Generation by Entropy-based Dynamic Temperature Sampling. 2024. [[arxiv]](https://arxiv.org/abs/2403.14541)
|
| 868 |
+
1. Weller et al. FollowIR: Evaluating and Teaching Information Retrieval Models to Follow Instructions. 2024. [[arxiv]](https://arxiv.org/abs/2403.15246)
|
| 869 |
+
1. Hongbin Na. CBT-LLM: A Chinese Large Language Model for Cognitive Behavioral Therapy-based Mental Health Question Answering. COLING 2024. [[arxiv]](https://arxiv.org/abs/2403.16008)
|
| 870 |
+
1. Zan et al. CodeS: Natural Language to Code Repository via Multi-Layer Sketch. 2024. [[arxiv]](https://arxiv.org/abs/2403.16443)
|
| 871 |
+
1. Liu et al. Extensive Self-Contrast Enables Feedback-Free Language Model Alignment. 2024. [[arxiv]](https://arxiv.org/abs/2404.00604)
|
| 872 |
+
1. Luo et al. BAdam: A Memory Efficient Full Parameter Training Method for Large Language Models. 2024. [[arxiv]](https://arxiv.org/abs/2404.02827)
|
| 873 |
+
1. Du et al. Chinese Tiny LLM: Pretraining a Chinese-Centric Large Language Model. 2024. [[arxiv]](https://arxiv.org/abs/2404.04167)
|
| 874 |
+
1. Ma et al. Parameter Efficient Quasi-Orthogonal Fine-Tuning via Givens Rotation. ICML 2024. [[arxiv]](https://arxiv.org/abs/2404.04316)
|
| 875 |
+
1. Liu et al. Dynamic Generation of Personalities with Large Language Models. 2024. [[arxiv]](https://arxiv.org/abs/2404.07084)
|
| 876 |
+
1. Shang et al. How Far Have We Gone in Stripped Binary Code Understanding Using Large Language Models. 2024. [[arxiv]](https://arxiv.org/abs/2404.09836)
|
| 877 |
+
1. Huang et al. LLMTune: Accelerate Database Knob Tuning with Large Language Models. 2024. [[arxiv]](https://arxiv.org/abs/2404.11581)
|
| 878 |
+
1. Deng et al. Text-Tuple-Table: Towards Information Integration in Text-to-Table Generation via Global Tuple Extraction. 2024. [[arxiv]](https://arxiv.org/abs/2404.14215)
|
| 879 |
+
1. Acikgoz et al. Hippocrates: An Open-Source Framework for Advancing Large Language Models in Healthcare. 2024. [[arxiv]](https://arxiv.org/abs/2404.16621)
|
| 880 |
+
1. Zhang et al. Small Language Models Need Strong Verifiers to Self-Correct Reasoning. ACL 2024 Findings. [[arxiv]](https://arxiv.org/abs/2404.17140)
|
| 881 |
+
1. Zhou et al. FREB-TQA: A Fine-Grained Robustness Evaluation Benchmark for Table Question Answering. NAACL 2024. [[arxiv]](https://arxiv.org/abs/2404.18585)
|
| 882 |
+
1. Xu et al. Large Language Models for Cyber Security: A Systematic Literature Review. 2024. [[arxiv]](https://arxiv.org/abs/2405.04760)
|
| 883 |
+
1. Dammu et al. "They are uncultured": Unveiling Covert Harms and Social Threats in LLM Generated Conversations. 2024. [[arxiv]](https://arxiv.org/abs/2405.05378)
|
| 884 |
+
1. Yi et al. A safety realignment framework via subspace-oriented model fusion for large language models. 2024. [[arxiv]](https://arxiv.org/abs/2405.09055)
|
| 885 |
+
1. Lou et al. SPO: Multi-Dimensional Preference Sequential Alignment With Implicit Reward Modeling. 2024. [[arxiv]](https://arxiv.org/abs/2405.12739)
|
| 886 |
+
1. Zhang et al. Getting More from Less: Large Language Models are Good Spontaneous Multilingual Learners. 2024. [[arxiv]](https://arxiv.org/abs/2405.13816)
|
| 887 |
+
1. Zhang et al. TS-Align: A Teacher-Student Collaborative Framework for Scalable Iterative Finetuning of Large Language Models. 2024. [[arxiv]](https://arxiv.org/abs/2405.20215)
|
| 888 |
+
1. Zihong Chen. Sentence Segmentation and Sentence Punctuation Based on XunziALLM. 2024. [[paper]](https://aclanthology.org/2024.lt4hala-1.30)
|
| 889 |
+
1. Gao et al. The Best of Both Worlds: Toward an Honest and Helpful Large Language Model. 2024. [[arxiv]](https://arxiv.org/abs/2406.00380)
|
| 890 |
+
1. Wang and Song. MARS: Benchmarking the Metaphysical Reasoning Abilities of Language Models with a Multi-task Evaluation Dataset. 2024. [[arxiv]](https://arxiv.org/abs/2406.02106)
|
| 891 |
+
1. Hu et al. Computational Limits of Low-Rank Adaptation (LoRA) for Transformer-Based Models. 2024. [[arxiv]](https://arxiv.org/abs/2406.03136)
|
| 892 |
+
1. Ge et al. Time Sensitive Knowledge Editing through Efficient Finetuning. ACL 2024. [[arxiv]](https://arxiv.org/abs/2406.04496)
|
| 893 |
+
1. Tan et al. Peer Review as A Multi-Turn and Long-Context Dialogue with Role-Based Interactions. 2024. [[arxiv]](https://arxiv.org/abs/2406.05688)
|
| 894 |
+
1. Song et al. Turbo Sparse: Achieving LLM SOTA Performance with Minimal Activated Parameters. 2024. [[arxiv]](https://arxiv.org/abs/2406.05955)
|
| 895 |
+
1. Gu et al. RWKV-CLIP: A Robust Vision-Language Representation Learner. 2024. [[arxiv]](https://arxiv.org/abs/2406.06973)
|
| 896 |
+
1. Chen et al. Advancing Tool-Augmented Large Language Models: Integrating Insights from Errors in Inference Trees. 2024. [[arxiv]](https://arxiv.org/abs/2406.07115)
|
| 897 |
+
1. Zhu et al. Are Large Language Models Good Statisticians?. 2024. [[arxiv]](https://arxiv.org/abs/2406.07815)
|
| 898 |
+
1. Li et al. Know the Unknown: An Uncertainty-Sensitive Method for LLM Instruction Tuning. 2024. [[arxiv]](https://arxiv.org/abs/2406.10099)
|
| 899 |
+
1. Ding et al. IntentionQA: A Benchmark for Evaluating Purchase Intention Comprehension Abilities of Language Models in E-commerce. 2024. [[arxiv]](https://arxiv.org/abs/2406.10173)
|
| 900 |
+
1. He et al. COMMUNITY-CROSS-INSTRUCT: Unsupervised Instruction Generation for Aligning Large Language Models to Online Communities. 2024. [[arxiv]](https://arxiv.org/abs/2406.12074)
|
| 901 |
+
1. Lin et al. FVEL: Interactive Formal Verification Environment with Large Language Models via Theorem Proving. 2024. [[arxiv]](https://arxiv.org/abs/2406.14408)
|
| 902 |
+
1. Treutlein et al. Connecting the Dots: LLMs can Infer and Verbalize Latent Structure from Disparate Training Data. 2024. [[arxiv]](https://arxiv.org/abs/2406.14546)
|
| 903 |
+
1. Feng et al. SS-Bench: A Benchmark for Social Story Generation and Evaluation. 2024. [[arxiv]](https://arxiv.org/abs/2406.15695)
|
| 904 |
+
1. Feng et al. Self-Constructed Context Decompilation with Fined-grained Alignment Enhancement. 2024. [[arxiv]](https://arxiv.org/abs/2406.17233)
|
| 905 |
+
1. Liu et al. Large Language Models for Cuffless Blood Pressure Measurement From Wearable Biosignals. 2024. [[arxiv]](https://arxiv.org/abs/2406.18069)
|
| 906 |
+
1. Iyer et al. Exploring Very Low-Resource Translation with LLMs: The University of Edinburgh's Submission to AmericasNLP 2024 Translation Task. AmericasNLP 2024. [[paper]](https://aclanthology.org/2024.americasnlp-1.25)
|
| 907 |
+
1. Li et al. Calibrating LLMs with Preference Optimization on Thought Trees for Generating Rationale in Science Question Scoring. 2024. [[arxiv]](https://arxiv.org/abs/2406.19949)
|
| 908 |
+
1. Yang et al. Financial Knowledge Large Language Model. 2024. [[arxiv]](https://arxiv.org/abs/2407.00365)
|
| 909 |
+
1. Lin et al. DogeRM: Equipping Reward Models with Domain Knowledge through Model Merging. 2024. [[arxiv]](https://arxiv.org/abs/2407.01470)
|
| 910 |
+
1. Bako et al. Evaluating the Semantic Profiling Abilities of LLMs for Natural Language Utterances in Data Visualization. 2024. [[arxiv]](https://arxiv.org/abs/2407.06129)
|
| 911 |
+
1. Huang et al. RoLoRA: Fine-tuning Rotated Outlier-free LLMs for Effective Weight-Activation Quantization. 2024. [[arxiv]](https://arxiv.org/abs/2407.08044)
|
| 912 |
+
1. Jiang et al. LLM-Collaboration on Automatic Science Journalism for the General Audience. 2024. [[arxiv]](https://arxiv.org/abs/2407.09756)
|
| 913 |
+
1. Inouye et al. Applied Auto-tuning on LoRA Hyperparameters. 2024. [[paper]](https://scholarcommons.scu.edu/cseng_senior/272/)
|
| 914 |
+
1. Qi et al. Research on Tibetan Tourism Viewpoints information generation system based on LLM. 2024. [[arxiv]](https://arxiv.org/abs/2407.13561)
|
| 915 |
+
1. Xu et al. Course-Correction: Safety Alignment Using Synthetic Preferences. 2024. [[arxiv]](https://arxiv.org/abs/2407.16637)
|
| 916 |
+
1. Sun et al. LAMBDA: A Large Model Based Data Agent. 2024. [[arxiv]](https://arxiv.org/abs/2407.17535)
|
| 917 |
+
1. Zhu et al. CollectiveSFT: Scaling Large Language Models for Chinese Medical Benchmark with Collective Instructions in Healthcare. 2024. [[arxiv]](https://arxiv.org/abs/2407.19705)
|
| 918 |
+
1. Yu et al. Correcting Negative Bias in Large Language Models through Negative Attention Score Alignment. 2024. [[arxiv]](https://arxiv.org/abs/2408.00137)
|
| 919 |
+
1. Xie et al. The Power of Personalized Datasets: Advancing Chinese Composition Writing for Elementary School through Targeted Model Fine-Tuning. IALP 2024. [[paper]](https://www.asianlp.sg/conferences/ialp2024/proceedings/papers/IALP2024_P055.pdf)
|
| 920 |
+
1. Liu et al. Instruct-Code-Llama: Improving Capabilities of Language Model in Competition Level Code Generation by Online Judge Feedback. ICIC 2024. [[paper]](https://link.springer.com/chapter/10.1007/978-981-97-5669-8_11)
|
| 921 |
+
1. Wang et al. Cybernetic Sentinels: Unveiling the Impact of Safety Data Selection on Model Security in Supervised Fine-Tuning. ICIC 2024. [[paper]](https://link.springer.com/chapter/10.1007/978-981-97-5669-8_23)
|
| 922 |
+
1. Xia et al. Understanding the Performance and Estimating the Cost of LLM Fine-Tuning. 2024. [[arxiv]](https://arxiv.org/abs/2408.04693)
|
| 923 |
+
1. Zeng et al. Perceive, Reflect, and Plan: Designing LLM Agent for Goal-Directed City Navigation without Instructions. 2024. [[arxiv]](https://arxiv.org/abs/2408.04168)
|
| 924 |
+
1. Xia et al. Using Pre-trained Language Model for Accurate ESG Prediction. FinNLP 2024. [[paper]](https://aclanthology.org/2024.finnlp-2.1/)
|
| 925 |
+
1. Liang et al. I-SHEEP: Self-Alignment of LLM from Scratch through an Iterative Self-Enhancement Paradigm. 2024. [[arxiv]](https://arxiv.org/abs/2408.08072)
|
| 926 |
+
1. Bai et al. Aligning Large Language Model with Direct Multi-Preference Optimization for Recommendation. CIKM 2024. [[paper]](https://dl.acm.org/doi/10.1145/3627673.3679611)
|
| 927 |
+
1. Zhang et al. CPsyCoun: A Report-based Multi-turn Dialogue Reconstruction and Evaluation Framework for Chinese Psychological Counseling. ACL 2024. [[paper]](https://aclanthology.org/2024.findings-acl.830.pdf)
|
| 928 |
+
1. **[StarWhisper](https://github.com/Yu-Yang-Li/StarWhisper)**: A large language model for Astronomy, based on ChatGLM2-6B and Qwen-14B.
|
| 929 |
+
1. **[DISC-LawLLM](https://github.com/FudanDISC/DISC-LawLLM)**: A large language model specialized in Chinese legal domain, based on Baichuan-13B, is capable of retrieving and reasoning on legal knowledge.
|
| 930 |
+
1. **[Sunsimiao](https://github.com/X-D-Lab/Sunsimiao)**: A large language model specialized in Chinese medical domain, based on Baichuan-7B and ChatGLM-6B.
|
| 931 |
+
1. **[CareGPT](https://github.com/WangRongsheng/CareGPT)**: A series of large language models for Chinese medical domain, based on LLaMA2-7B and Baichuan-13B.
|
| 932 |
+
1. **[MachineMindset](https://github.com/PKU-YuanGroup/Machine-Mindset/)**: A series of MBTI Personality large language models, capable of giving any LLM 16 different personality types based on different datasets and training methods.
|
| 933 |
+
1. **[Luminia-13B-v3](https://huggingface.co/Nekochu/Luminia-13B-v3)**: A large language model specialized in generate metadata for stable diffusion. [[demo]](https://huggingface.co/spaces/Nekochu/Luminia-13B_SD_Prompt)
|
| 934 |
+
1. **[Chinese-LLaVA-Med](https://github.com/BUAADreamer/Chinese-LLaVA-Med)**: A multimodal large language model specialized in Chinese medical domain, based on LLaVA-1.5-7B.
|
| 935 |
+
1. **[AutoRE](https://github.com/THUDM/AutoRE)**: A document-level relation extraction system based on large language models.
|
| 936 |
+
1. **[NVIDIA RTX AI Toolkit](https://github.com/NVIDIA/RTX-AI-Toolkit)**: SDKs for fine-tuning LLMs on Windows PC for NVIDIA RTX.
|
| 937 |
+
1. **[LazyLLM](https://github.com/LazyAGI/LazyLLM)**: An easy and lazy way for building multi-agent LLMs applications and supports model fine-tuning via LLaMA Factory.
|
| 938 |
+
1. **[RAG-Retrieval](https://github.com/NLPJCL/RAG-Retrieval)**: A full pipeline for RAG retrieval model fine-tuning, inference, and distillation. [[blog]](https://zhuanlan.zhihu.com/p/987727357)
|
| 939 |
+
1. **[360-LLaMA-Factory](https://github.com/Qihoo360/360-LLaMA-Factory)**: A modified library that supports long sequence SFT & DPO using ring attention.
|
| 940 |
+
1. **[Sky-T1](https://novasky-ai.github.io/posts/sky-t1/)**: An o1-like model fine-tuned by NovaSky AI with very small cost.
|
| 941 |
+
1. **[WeClone](https://github.com/xming521/WeClone)**: One-stop solution for creating your digital avatar from chat logs.
|
| 942 |
+
1. **[EmoLLM](https://github.com/SmartFlowAI/EmoLLM)**: A project about large language models (LLMs) and mental health.
|
| 943 |
+
</details>
|
| 944 |
+
|
| 945 |
+
## License
|
| 946 |
+
|
| 947 |
+
This repository is licensed under the [Apache-2.0 License](LICENSE).
|
| 948 |
+
|
| 949 |
+
Please follow the model licenses to use the corresponding model weights: [Baichuan 2](https://huggingface.co/baichuan-inc/Baichuan2-7B-Base/blob/main/Community%20License%20for%20Baichuan%202%20Model.pdf) / [BLOOM](https://huggingface.co/spaces/bigscience/license) / [ChatGLM3](https://github.com/THUDM/ChatGLM3/blob/main/MODEL_LICENSE) / [Command R](https://cohere.com/c4ai-cc-by-nc-license) / [DeepSeek](https://github.com/deepseek-ai/DeepSeek-LLM/blob/main/LICENSE-MODEL) / [Falcon](https://huggingface.co/tiiuae/falcon-180B/blob/main/LICENSE.txt) / [Gemma](https://ai.google.dev/gemma/terms) / [GLM-4](https://huggingface.co/THUDM/glm-4-9b/blob/main/LICENSE) / [GPT-2](https://github.com/openai/gpt-2/blob/master/LICENSE) / [Granite](LICENSE) / [Index](https://huggingface.co/IndexTeam/Index-1.9B/blob/main/LICENSE) / [InternLM](https://github.com/InternLM/InternLM#license) / [Llama](https://github.com/facebookresearch/llama/blob/main/MODEL_CARD.md) / [Llama 2](https://ai.meta.com/llama/license/) / [Llama 3](https://llama.meta.com/llama3/license/) / [Llama 4](https://github.com/meta-llama/llama-models/blob/main/models/llama4/LICENSE) / [MiniCPM](https://github.com/OpenBMB/MiniCPM/blob/main/MiniCPM%20Model%20License.md) / [Mistral/Mixtral/Pixtral](LICENSE) / [OLMo](LICENSE) / [Phi-1.5/Phi-2](https://huggingface.co/microsoft/phi-1_5/resolve/main/Research%20License.docx) / [Phi-3/Phi-4](https://huggingface.co/microsoft/Phi-3-mini-4k-instruct/blob/main/LICENSE) / [Qwen](https://github.com/QwenLM/Qwen/blob/main/Tongyi%20Qianwen%20LICENSE%20AGREEMENT) / [Skywork](https://huggingface.co/Skywork/Skywork-13B-base/blob/main/Skywork%20Community%20License.pdf) / [StarCoder 2](https://huggingface.co/spaces/bigcode/bigcode-model-license-agreement) / [TeleChat2](https://huggingface.co/Tele-AI/telechat-7B/blob/main/TeleChat%E6%A8%A1%E5%9E%8B%E7%A4%BE%E5%8C%BA%E8%AE%B8%E5%8F%AF%E5%8D%8F%E8%AE%AE.pdf) / [XVERSE](https://github.com/xverse-ai/XVERSE-13B/blob/main/MODEL_LICENSE.pdf) / [Yi](https://huggingface.co/01-ai/Yi-6B/blob/main/LICENSE) / [Yi-1.5](LICENSE) / [Yuan 2](https://github.com/IEIT-Yuan/Yuan-2.0/blob/main/LICENSE-Yuan)
|
| 950 |
+
|
| 951 |
+
## Citation
|
| 952 |
+
|
| 953 |
+
If this work is helpful, please kindly cite as:
|
| 954 |
+
|
| 955 |
+
```bibtex
|
| 956 |
+
@inproceedings{zheng2024llamafactory,
|
| 957 |
+
title={LlamaFactory: Unified Efficient Fine-Tuning of 100+ Language Models},
|
| 958 |
+
author={Yaowei Zheng and Richong Zhang and Junhao Zhang and Yanhan Ye and Zheyan Luo and Zhangchi Feng and Yongqiang Ma},
|
| 959 |
+
booktitle={Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 3: System Demonstrations)},
|
| 960 |
+
address={Bangkok, Thailand},
|
| 961 |
+
publisher={Association for Computational Linguistics},
|
| 962 |
+
year={2024},
|
| 963 |
+
url={http://arxiv.org/abs/2403.13372}
|
| 964 |
+
}
|
| 965 |
+
```
|
| 966 |
+
|
| 967 |
+
## Acknowledgement
|
| 968 |
+
|
| 969 |
+
This repo benefits from [PEFT](https://github.com/huggingface/peft), [TRL](https://github.com/huggingface/trl), [QLoRA](https://github.com/artidoro/qlora) and [FastChat](https://github.com/lm-sys/FastChat). Thanks for their wonderful works.
|
| 970 |
+
|
| 971 |
+
## Star History
|
| 972 |
+
|
| 973 |
+

|
README_zh.md
ADDED
|
@@ -0,0 +1,974 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+

|
| 2 |
+
|
| 3 |
+
[](https://github.com/hiyouga/LLaMA-Factory/stargazers)
|
| 4 |
+
[](https://github.com/hiyouga/LLaMA-Factory/commits/main)
|
| 5 |
+
[](https://github.com/hiyouga/LLaMA-Factory/graphs/contributors)
|
| 6 |
+
[](https://github.com/hiyouga/LLaMA-Factory/actions/workflows/tests.yml)
|
| 7 |
+
[](https://pypi.org/project/llamafactory/)
|
| 8 |
+
[](https://scholar.google.com/scholar?cites=12620864006390196564)
|
| 9 |
+
[](https://hub.docker.com/r/hiyouga/llamafactory/tags)
|
| 10 |
+
|
| 11 |
+
[](https://twitter.com/llamafactory_ai)
|
| 12 |
+
[](https://discord.gg/rKfvV9r9FK)
|
| 13 |
+
|
| 14 |
+
[](https://colab.research.google.com/drive/1d5KQtbemerlSDSxZIfAaWXhKr30QypiK?usp=sharing)
|
| 15 |
+
[](https://gallery.pai-ml.com/#/preview/deepLearning/nlp/llama_factory)
|
| 16 |
+
[](https://www.lab4ai.cn/course/detail?id=7c13e60f6137474eb40f6fd3983c0f46&utm_source=LLaMA-Factory)
|
| 17 |
+
[](https://www.llamafactory.com.cn/?utm_source=LLaMA-Factory)
|
| 18 |
+
[](https://huggingface.co/spaces/hiyouga/LLaMA-Board)
|
| 19 |
+
[](https://modelscope.cn/studios/hiyouga/LLaMA-Board)
|
| 20 |
+
[](https://novita.ai/templates-library/105981?sharer=88115474-394e-4bda-968e-b88e123d0c47)
|
| 21 |
+
|
| 22 |
+
### 获得[亚马逊](https://aws.amazon.com/cn/blogs/china/a-one-stop-code-free-model-fine-tuning-deployment-platform-based-on-sagemaker-and-llama-factory/)、[英伟达](https://developer.nvidia.cn/rtx/ai-toolkit)、[阿里云](https://help.aliyun.com/zh/pai/use-cases/fine-tune-a-llama-3-model-with-llama-factory)等的应用。
|
| 23 |
+
|
| 24 |
+
<div align="center" markdown="1">
|
| 25 |
+
|
| 26 |
+
### 赞助商 ❤️
|
| 27 |
+
|
| 28 |
+
| <div style="text-align: center;"><a href="https://warp.dev/llama-factory"><img alt="Warp sponsorship" width="400" src="assets/sponsors/warp.jpg"></a><br><a href="https://warp.dev/llama-factory" style="font-size:larger;">Warp,面向开发者的智能终端</a><br><a href="https://warp.dev/llama-factory">适用于 MacOS、Linux 和 Windows</a> | <a href="https://serpapi.com"><img alt="SerpAPI sponsorship" width="250" src="assets/sponsors/serpapi.svg"> </a> |
|
| 29 |
+
| ---- | ---- |
|
| 30 |
+
|
| 31 |
+
----
|
| 32 |
+
|
| 33 |
+
### 使用零代码[命令行](#快速开始)与 [Web UI](#llama-board-可视化微调由-gradio-驱动) 轻松微调百余种大模型
|
| 34 |
+
|
| 35 |
+

|
| 36 |
+
|
| 37 |
+
</div>
|
| 38 |
+
|
| 39 |
+
👋 加入我们的[微信群](https://github.com/hiyouga/llamafactory-community/blob/main/wechat/main.jpg)、[NPU 用户群](https://github.com/hiyouga/llamafactory-community/blob/main/wechat/npu.jpg)、[大模型实验室群](https://github.com/hiyouga/llamafactory-community/blob/main/wechat/lab4ai.jpg) 或 [LLaMA Factory Online 用户群](https://github.com/hiyouga/llamafactory-community/blob/main/wechat/online.png)。
|
| 40 |
+
|
| 41 |
+
\[ [English](README.md) | 中文 \]
|
| 42 |
+
|
| 43 |
+
**微调大模型可以像这样轻松…**
|
| 44 |
+
|
| 45 |
+
https://github.com/user-attachments/assets/43b700c6-a178-41db-b1f8-8190a5d3fcfc
|
| 46 |
+
|
| 47 |
+
选择你的打开方式:
|
| 48 |
+
|
| 49 |
+
- **入门教程**:https://zhuanlan.zhihu.com/p/695287607
|
| 50 |
+
- **微调视频教程**:https://www.bilibili.com/video/BV1djgRzxEts/
|
| 51 |
+
- **框架文档**:https://llamafactory.readthedocs.io/zh-cn/latest/
|
| 52 |
+
- **框架文档(昇腾 NPU)**:https://ascend.github.io/docs/sources/llamafactory/
|
| 53 |
+
- **Colab(免费)**:https://colab.research.google.com/drive/1d5KQtbemerlSDSxZIfAaWXhKr30QypiK?usp=sharing
|
| 54 |
+
- **本地机器**:请见[如何使用](#如何使用)
|
| 55 |
+
- **PAI-DSW(免费试用)**:https://gallery.pai-ml.com/#/preview/deepLearning/nlp/llama_factory
|
| 56 |
+
- **九章智算云(算力优惠活动)**:https://docs.alayanew.com/docs/documents/useGuide/LLaMAFactory/mutiple/?utm_source=LLaMA-Factory
|
| 57 |
+
- **官方课程**:https://www.lab4ai.cn/course/detail?id=7c13e60f6137474eb40f6fd3983c0f46&utm_source=LLaMA-Factory
|
| 58 |
+
- **LLaMA Factory Online(在线微调)**:https://www.llamafactory.com.cn/?utm_source=LLaMA-Factory
|
| 59 |
+
|
| 60 |
+
> [!NOTE]
|
| 61 |
+
> 除上述链接以外的其他网站均为未经许可的第三方网站,请小心甄别。
|
| 62 |
+
|
| 63 |
+
## 目录
|
| 64 |
+
|
| 65 |
+
- [项目特色](#项目特色)
|
| 66 |
+
- [官方博客](#官方博客)
|
| 67 |
+
- [更新日志](#更新日志)
|
| 68 |
+
- [模型](#模型)
|
| 69 |
+
- [训练方法](#训练方法)
|
| 70 |
+
- [数据集](#数据集)
|
| 71 |
+
- [软硬件依赖](#软硬件依赖)
|
| 72 |
+
- [如何使用](#如何使用)
|
| 73 |
+
- [安装 LLaMA Factory](#安装-llama-factory)
|
| 74 |
+
- [数据准备](#数据准备)
|
| 75 |
+
- [快速开始](#快速开始)
|
| 76 |
+
- [LLaMA Board 可视化微调](#llama-board-可视化微调由-gradio-驱动)
|
| 77 |
+
- [LLaMA Factory Online 在线微调](#llama-factory-online-在线微调)
|
| 78 |
+
- [构建 Docker](#构建-docker)
|
| 79 |
+
- [利用 vLLM 部署 OpenAI API](#利用-vllm-部署-openai-api)
|
| 80 |
+
- [从魔搭社区下载](#从魔搭社区下载)
|
| 81 |
+
- [从魔乐社区下载](#从魔乐社区下载)
|
| 82 |
+
- [使用 W&B 面板](#使用-wb-面板)
|
| 83 |
+
- [使用 SwanLab 面板](#使用-swanlab-面板)
|
| 84 |
+
- [使用了 LLaMA Factory 的项目](#使用了-llama-factory-的项目)
|
| 85 |
+
- [协议](#协议)
|
| 86 |
+
- [引用](#引用)
|
| 87 |
+
- [致谢](#致谢)
|
| 88 |
+
|
| 89 |
+
## 项目特色
|
| 90 |
+
|
| 91 |
+
- **多种模型**:LLaMA、LLaVA、Mistral、Mixtral-MoE、Qwen、Qwen2-VL、DeepSeek、Yi、Gemma、ChatGLM、Phi 等等。
|
| 92 |
+
- **集成方法**:(增量)预训练、(多模态)指令监督微调、奖励模型训练、PPO 训练、DPO 训练、KTO 训练、ORPO 训练等等。
|
| 93 |
+
- **多种精度**:16 比特全参数微调、冻结微调、LoRA 微调和基于 AQLM/AWQ/GPTQ/LLM.int8/HQQ/EETQ 的 2/3/4/5/6/8 比特 QLoRA 微调。
|
| 94 |
+
- **先进算法**:[GaLore](https://github.com/jiaweizzhao/GaLore)、[BAdam](https://github.com/Ledzy/BAdam)、[APOLLO](https://github.com/zhuhanqing/APOLLO)、[Adam-mini](https://github.com/zyushun/Adam-mini)、[Muon](https://github.com/KellerJordan/Muon)、[OFT](https://github.com/huggingface/peft/tree/main/src/peft/tuners/oft)、DoRA、LongLoRA、LLaMA Pro、Mixture-of-Depths、LoRA+、LoftQ 和 PiSSA。
|
| 95 |
+
- **实用技巧**:[FlashAttention-2](https://github.com/Dao-AILab/flash-attention)、[Unsloth](https://github.com/unslothai/unsloth)、[Liger Kernel](https://github.com/linkedin/Liger-Kernel)、RoPE scaling、NEFTune 和 rsLoRA。
|
| 96 |
+
- **广泛任务**:多轮对话、工具调用、图像理解、视觉定位、视频识别和语音理解等等。
|
| 97 |
+
- **实验监控**:LlamaBoard、TensorBoard、Wandb、MLflow、[SwanLab](https://github.com/SwanHubX/SwanLab) 等等。
|
| 98 |
+
- **极速推理**:基于 [vLLM](https://github.com/vllm-project/vllm) 或 [SGLang](https://github.com/sgl-project/sglang) 的 OpenAI 风格 API、浏览器界面和命令行接口。
|
| 99 |
+
|
| 100 |
+
### 最新模型的 Day-N 微调适配
|
| 101 |
+
|
| 102 |
+
| 适配时间 | 模型名称 |
|
| 103 |
+
| ------------ | -------------------------------------------------------------------- |
|
| 104 |
+
| Day 0 | Qwen3 / Qwen2.5-VL / Gemma 3 / GLM-4.1V / InternLM 3 / MiniCPM-o-2.6 |
|
| 105 |
+
| Day 1 | Llama 3 / GLM-4 / Mistral Small / PaliGemma2 / Llama 4 |
|
| 106 |
+
|
| 107 |
+
## 官方博客
|
| 108 |
+
|
| 109 |
+
- 💡 [Easy Dataset × LLaMA Factory: 让大模型高效学习领域知识](https://buaa-act.feishu.cn/wiki/KY9xwTGs1iqHrRkjXBwcZP9WnL9)(中文)
|
| 110 |
+
- [使用 LLaMA-Factory 微调心理健康大模型](https://www.lab4ai.cn/project/detail?id=25cce32ec131497b9e06a93336a0817f&type=project&utm_source=LLaMA-Factory)(中文)
|
| 111 |
+
- [使用 LLaMA-Factory 构建 GPT-OSS 角色扮演模型](https://docs.llamafactory.com.cn/docs/documents/best-practice/gptroleplay/?utm_source=LLaMA-Factory)(中文)
|
| 112 |
+
- [基于 LLaMA-Factory 和 EasyR1 打造一站式无代码大模型强化学习和部署平台 LLM Model Hub](https://aws.amazon.com/cn/blogs/china/building-llm-model-hub-based-on-llamafactory-and-easyr1/)(中文)
|
| 113 |
+
- [通过亚马逊 SageMaker HyperPod 上的 LLaMA-Factory 增强多模态模型银行文档的视觉信息提取](https://aws.amazon.com/cn/blogs/machine-learning/how-apoidea-group-enhances-visual-information-extraction-from-banking-documents-with-multimodal-models-using-llama-factory-on-amazon-sagemaker-hyperpod/)(英文)
|
| 114 |
+
|
| 115 |
+
<details><summary>全部博客</summary>
|
| 116 |
+
|
| 117 |
+
- [使用 LLaMA-Factory 微调 Llama3.1-70B 医学诊断模型](https://docs.alayanew.com/docs/documents/bestPractice/bigModel/llama70B/?utm_source=LLaMA-Factory)(中文)
|
| 118 |
+
- [使用 LLaMA-Factory 微调 Qwen2.5-VL 实现自动驾驶场景微调](https://docs.alayanew.com/docs/documents/useGuide/LLaMAFactory/mutiple/?utm_source=LLaMA-Factory)(中文)
|
| 119 |
+
- [LLaMA Factory:微调 DeepSeek-R1-Distill-Qwen-7B 模型实现新闻标题分类器](https://gallery.pai-ml.com/#/preview/deepLearning/nlp/llama_factory_deepseek_r1_distill_7b)(中文)
|
| 120 |
+
- [基于 Amazon SageMaker 和 LLaMA-Factory 打造一站式无代码模型微调部署平台 Model Hub](https://aws.amazon.com/cn/blogs/china/a-one-stop-code-free-model-fine-tuning-deployment-platform-based-on-sagemaker-and-llama-factory/)(中文)
|
| 121 |
+
- [LLaMA Factory 多模态微调实践:微调 Qwen2-VL 构建文旅大模型](https://gallery.pai-ml.com/#/preview/deepLearning/nlp/llama_factory_qwen2vl)(中文)
|
| 122 |
+
- [LLaMA Factory:微调 Llama3 模型实现角色扮演](https://gallery.pai-ml.com/#/preview/deepLearning/nlp/llama_factory)(中文)
|
| 123 |
+
|
| 124 |
+
</details>
|
| 125 |
+
|
| 126 |
+
## 更新日志
|
| 127 |
+
|
| 128 |
+
[25/08/22] 我们支持了 **[OFT](https://arxiv.org/abs/2306.07280)** 和 **[OFTv2](https://arxiv.org/abs/2506.19847)** 模型的微调。查看 [examples](examples/README.md) 以使用。
|
| 129 |
+
|
| 130 |
+
[25/08/20] 我们支持了 **[Intern-S1-mini](https://huggingface.co/internlm/Intern-S1-mini)** 模型的微调。查看 [PR #8976](https://github.com/hiyouga/LLaMA-Factory/pull/8976) 以使用。
|
| 131 |
+
|
| 132 |
+
[25/08/06] 我们支持了 **[GPT-OSS](https://github.com/openai/gpt-oss)** 模型的微调。查看 [PR #8826](https://github.com/hiyouga/LLaMA-Factory/pull/8826) 以使用。
|
| 133 |
+
|
| 134 |
+
<details><summary>展开日志</summary>
|
| 135 |
+
|
| 136 |
+
[25/07/02] 我们支持了 **[GLM-4.1V-9B-Thinking](https://github.com/THUDM/GLM-4.1V-Thinking)** 模型的微调。
|
| 137 |
+
|
| 138 |
+
[25/04/28] 我们支持了 **[Qwen3](https://qwenlm.github.io/blog/qwen3/)** 系列模型的微调。
|
| 139 |
+
|
| 140 |
+
[25/04/21] 我们支持了 **[Muon](https://github.com/KellerJordan/Muon)** 优化器。详细用法请参照 [examples](examples/README_zh.md)。感谢 [@tianshijing](https://github.com/tianshijing) 的 PR。
|
| 141 |
+
|
| 142 |
+
[25/04/16] 我们支持了 **[InternVL3](https://huggingface.co/OpenGVLab/InternVL3-8B)** 模型的微调。查看 [PR #7258](https://github.com/hiyouga/LLaMA-Factory/pull/7258) 以使用。
|
| 143 |
+
|
| 144 |
+
[25/04/14] 我们支持了 **[GLM-Z1](https://huggingface.co/THUDM/GLM-Z1-9B-0414)** 和 **[Kimi-VL](https://huggingface.co/moonshotai/Kimi-VL-A3B-Instruct)** 模型的微调。
|
| 145 |
+
|
| 146 |
+
[25/04/06] 我们支持了 **[Llama 4](https://ai.meta.com/blog/llama-4-multimodal-intelligence/)** 模型的微调。查看 [PR #7611](https://github.com/hiyouga/LLaMA-Factory/pull/7611) 以使用。
|
| 147 |
+
|
| 148 |
+
[25/03/31] 我们支持了 **[Qwen2.5 Omni](https://qwenlm.github.io/blog/qwen2.5-omni/)** 模型的微调。查看 [PR #7537](https://github.com/hiyouga/LLaMA-Factory/pull/7537) 以使用。
|
| 149 |
+
|
| 150 |
+
[25/03/15] 我们支持了 **[SGLang](https://github.com/sgl-project/sglang)** 推理后端,请使用 `infer_backend: sglang` 启用。
|
| 151 |
+
|
| 152 |
+
[25/03/12] 我们支持了 **[Gemma 3](https://huggingface.co/blog/gemma3)** 模型的微调。
|
| 153 |
+
|
| 154 |
+
[25/02/24] 我们宣布开源 **[EasyR1](https://github.com/hiyouga/EasyR1)**,一个高效可扩展的多模态强化学习框架,支持高效的 GRPO 训练。
|
| 155 |
+
|
| 156 |
+
[25/02/11] 我们支持了在导出模型时保存 **[Ollama](https://github.com/ollama/ollama)** 配置文件。详细用法请参照 [examples](examples/README_zh.md)。
|
| 157 |
+
|
| 158 |
+
[25/02/05] 我们支持了在语音理解任务上微调 **[Qwen2-Audio](Qwen/Qwen2-Audio-7B-Instruct)** 和 **[MiniCPM-o-2.6](https://huggingface.co/openbmb/MiniCPM-o-2_6)** 模型。
|
| 159 |
+
|
| 160 |
+
[25/01/31] 我们支持了 **[DeepSeek-R1](https://huggingface.co/deepseek-ai/DeepSeek-R1)** 和 **[Qwen2.5-VL](https://huggingface.co/Qwen/Qwen2.5-VL-7B-Instruct)** 模型的微调。
|
| 161 |
+
|
| 162 |
+
[25/01/15] 我们支持了 **[APOLLO](https://arxiv.org/abs/2412.05270)** 优化器。详细用法请参照 [examples](examples/README_zh.md)。
|
| 163 |
+
|
| 164 |
+
[25/01/14] 我们支持了 **[MiniCPM-o-2.6](https://huggingface.co/openbmb/MiniCPM-o-2_6)** 和 **[MiniCPM-V-2.6](https://huggingface.co/openbmb/MiniCPM-V-2_6)** 模型的微调。 感谢 [@BUAADreamer](https://github.com/BUAADreamer) 的 PR.
|
| 165 |
+
|
| 166 |
+
[25/01/14] 我们支持了 **[InternLM 3](https://huggingface.co/collections/internlm/)** 模型的微调。感谢 [@hhaAndroid](https://github.com/hhaAndroid) 的 PR。
|
| 167 |
+
|
| 168 |
+
[25/01/10] 我们支持了 **[Phi-4](https://huggingface.co/microsoft/phi-4)** 模型的微调。
|
| 169 |
+
|
| 170 |
+
[24/12/21] 我们支持了使用 **[SwanLab](https://github.com/SwanHubX/SwanLab)** 跟踪与可视化实验。详细用法请参考 [此部分](#使用-swanlab-面板)。
|
| 171 |
+
|
| 172 |
+
[24/11/27] 我们支持了 **[Skywork-o1](https://huggingface.co/Skywork/Skywork-o1-Open-Llama-3.1-8B)** 模型的微调和 **[OpenO1](https://huggingface.co/datasets/O1-OPEN/OpenO1-SFT)** 数据集。
|
| 173 |
+
|
| 174 |
+
[24/10/09] 我们支持了从 **[魔乐社区](https://modelers.cn/models)** 下载预训练模型和数据集。详细用法请参照 [此教程](#从魔乐社区下载)。
|
| 175 |
+
|
| 176 |
+
[24/09/19] 我们支持了 **[Qwen2.5](https://qwenlm.github.io/blog/qwen2.5/)** 模型的微调。
|
| 177 |
+
|
| 178 |
+
[24/08/30] 我们支持了 **[Qwen2-VL](https://qwenlm.github.io/blog/qwen2-vl/)** 模型的微调。感谢 [@simonJJJ](https://github.com/simonJJJ) 的 PR。
|
| 179 |
+
|
| 180 |
+
[24/08/27] 我们支持了 **[Liger Kernel](https://github.com/linkedin/Liger-Kernel)**。请使用 `enable_liger_kernel: true` 来加速训练。
|
| 181 |
+
|
| 182 |
+
[24/08/09] 我们支持了 **[Adam-mini](https://github.com/zyushun/Adam-mini)** 优化器。详细用法请参照 [examples](examples/README_zh.md)。感谢 [@relic-yuexi](https://github.com/relic-yuexi) 的 PR。
|
| 183 |
+
|
| 184 |
+
[24/07/04] 我们支持了[无污染打包训练](https://github.com/MeetKai/functionary/tree/main/functionary/train/packing)。请使用 `neat_packing: true` 参数。感谢 [@chuan298](https://github.com/chuan298) 的 PR。
|
| 185 |
+
|
| 186 |
+
[24/06/16] 我们支持了 **[PiSSA](https://arxiv.org/abs/2404.02948)** 算法。详细用法请参照 [examples](examples/README_zh.md)。
|
| 187 |
+
|
| 188 |
+
[24/06/07] 我们支持了 **[Qwen2](https://qwenlm.github.io/blog/qwen2/)** 和 **[GLM-4](https://github.com/THUDM/GLM-4)** 模型的微调。
|
| 189 |
+
|
| 190 |
+
[24/05/26] 我们支持了 **[SimPO](https://arxiv.org/abs/2405.14734)** 偏好对齐算法。详细用法请参照 [examples](examples/README_zh.md)。
|
| 191 |
+
|
| 192 |
+
[24/05/20] 我们支持了 **PaliGemma** 系列模型的微调。注意 PaliGemma 是预训练模型,你需要使用 `paligemma` 模板进行微调使其获得对话能力。
|
| 193 |
+
|
| 194 |
+
[24/05/18] 我们支持了 **[KTO](https://arxiv.org/abs/2402.01306)** 偏好对齐算法。详细用法请参照 [examples](examples/README_zh.md)。
|
| 195 |
+
|
| 196 |
+
[24/05/14] 我们支持了昇腾 NPU 设备的训练和推理。详情请查阅[安装](#安装-llama-factory)部分。
|
| 197 |
+
|
| 198 |
+
[24/04/26] 我们支持了多模态模型 **LLaVA-1.5** 的微调。详细用法请参照 [examples](examples/README_zh.md)。
|
| 199 |
+
|
| 200 |
+
[24/04/22] 我们提供了在免费 T4 GPU 上微调 Llama-3 模型的 **[Colab 笔记本](https://colab.research.google.com/drive/1d5KQtbemerlSDSxZIfAaWXhKr30QypiK?usp=sharing)**。Hugging Face 社区公开了两个利用 LLaMA Factory 微调的 Llama-3 模型,详情请见 [Llama3-8B-Chinese-Chat](https://huggingface.co/shenzhi-wang/Llama3-8B-Chinese-Chat) 和 [Llama3-Chinese](https://huggingface.co/zhichen/Llama3-Chinese)。
|
| 201 |
+
|
| 202 |
+
[24/04/21] 我们基于 [AstraMindAI 的仓库](https://github.com/astramind-ai/Mixture-of-depths)支持了 **[混合深度训练](https://arxiv.org/abs/2404.02258)**。详细用法请参照 [examples](examples/README_zh.md)。
|
| 203 |
+
|
| 204 |
+
[24/04/16] 我们支持了 **[BAdam](https://arxiv.org/abs/2404.02827)** 优化器。详细用法请参照 [examples](examples/README_zh.md)。
|
| 205 |
+
|
| 206 |
+
[24/04/16] 我们支持了 **[unsloth](https://github.com/unslothai/unsloth)** 的长序列训练(24GB 可训练 Llama-2-7B-56k)。该方法相比 FlashAttention-2 提供了 **117%** 的训练速度和 **50%** 的显存节约。更多数据请见[此页面](https://github.com/hiyouga/LLaMA-Factory/wiki/Performance-comparison)。
|
| 207 |
+
|
| 208 |
+
[24/03/31] 我们支持了 **[ORPO](https://arxiv.org/abs/2403.07691)**。详细用法请参照 [examples](examples/README_zh.md)。
|
| 209 |
+
|
| 210 |
+
[24/03/21] 我们的论文 "[LlamaFactory: Unified Efficient Fine-Tuning of 100+ Language Models](https://arxiv.org/abs/2403.13372)" 可在 arXiv 上查看!
|
| 211 |
+
|
| 212 |
+
[24/03/20] 我们支持了能在 2x24GB GPU 上微调 70B 模型的 **FSDP+QLoRA**。详细用法请参照 [examples](examples/README_zh.md)。
|
| 213 |
+
|
| 214 |
+
[24/03/13] 我们支持了 **[LoRA+](https://arxiv.org/abs/2402.12354)**。详细用法请参照 [examples](examples/README_zh.md)。
|
| 215 |
+
|
| 216 |
+
[24/03/07] 我们支持了 **[GaLore](https://arxiv.org/abs/2403.03507)** 优化器。详细用法请参照 [examples](examples/README_zh.md)。
|
| 217 |
+
|
| 218 |
+
[24/03/07] 我们集成了 **[vLLM](https://github.com/vllm-project/vllm)** 以实现极速并发推理。请使用 `infer_backend: vllm` 来获得 **270%** 的推理速度。
|
| 219 |
+
|
| 220 |
+
[24/02/28] 我们支持了 **[DoRA](https://arxiv.org/abs/2402.09353)** 微调。请使用 `use_dora: true` 参数进行 DoRA 微调。
|
| 221 |
+
|
| 222 |
+
[24/02/15] 我们支持了 [LLaMA Pro](https://github.com/TencentARC/LLaMA-Pro) 提出的**块扩展**方法。详细用法请参照 [examples](examples/README_zh.md)。
|
| 223 |
+
|
| 224 |
+
[24/02/05] Qwen1.5(Qwen2 测试版)系列模型已在 LLaMA-Factory 中实现微调支持。详情请查阅该[博客页面](https://qwenlm.github.io/zh/blog/qwen1.5/)。
|
| 225 |
+
|
| 226 |
+
[24/01/18] 我们针对绝大多数模型实现了 **Agent 微调**,微调时指定 `dataset: glaive_toolcall_zh` 即可使模型获得工具调用能力。
|
| 227 |
+
|
| 228 |
+
[23/12/23] 我们针对 LLaMA, Mistral 和 Yi 模型支持了 **[unsloth](https://github.com/unslothai/unsloth)** 的 LoRA 训练加速。请使用 `use_unsloth: true` 参数启用 unsloth 优化。该方法可提供 **170%** 的训练速度,详情请查阅[此页面](https://github.com/hiyouga/LLaMA-Factory/wiki/Performance-comparison)。
|
| 229 |
+
|
| 230 |
+
[23/12/12] 我们支持了微调最新的混合专家模型 **[Mixtral 8x7B](https://huggingface.co/mistralai/Mixtral-8x7B-v0.1)**。硬件需求请查阅[此处](#硬件依赖)。
|
| 231 |
+
|
| 232 |
+
[23/12/01] 我们支持了从 **[魔搭社区](https://modelscope.cn/models)** 下载预训练模型和数据集。详细用法请参照 [此教程](#从魔搭社区下载)。
|
| 233 |
+
|
| 234 |
+
[23/10/21] 我们支持了 **[NEFTune](https://arxiv.org/abs/2310.05914)** 训练技巧。请使用 `neftune_noise_alpha: 5` 参数启用 NEFTune。
|
| 235 |
+
|
| 236 |
+
[23/09/27] 我们针对 LLaMA 模型支持了 [LongLoRA](https://github.com/dvlab-research/LongLoRA) 提出的 **$S^2$-Attn**。请使用 `shift_attn: true` 参数以启用该功能。
|
| 237 |
+
|
| 238 |
+
[23/09/23] 我们在项目中集成了 MMLU、C-Eval 和 CMMLU 评估集。详细用法请参照 [examples](examples/README_zh.md)。
|
| 239 |
+
|
| 240 |
+
[23/09/10] 我们支持了 **[FlashAttention-2](https://github.com/Dao-AILab/flash-attention)**。如果您使用的是 RTX4090、A100 或 H100 GPU,请使用 `flash_attn: fa2` 参数以启用 FlashAttention-2。
|
| 241 |
+
|
| 242 |
+
[23/08/12] 我们支持了 **RoPE 插值**来扩展 LLaMA 模型的上下文长度。请使用 `rope_scaling: linear` 参数训练模型或使用 `rope_scaling: dynamic` 参数评估模型。
|
| 243 |
+
|
| 244 |
+
[23/08/11] 我们支持了指令模型的 **[DPO 训练](https://arxiv.org/abs/2305.18290)**。详细用法请参照 [examples](examples/README_zh.md)。
|
| 245 |
+
|
| 246 |
+
[23/07/31] 我们支持了**数据流式加载**。请使用 `streaming: true` 和 `max_steps: 10000` 参数来流式加载数据集。
|
| 247 |
+
|
| 248 |
+
[23/07/29] 我们在 Hugging Face 发布了两个 13B 指令微调模型。详细内容请查阅我们的 Hugging Face 项目([LLaMA-2](https://huggingface.co/hiyouga/Llama-2-Chinese-13b-chat) / [Baichuan](https://huggingface.co/hiyouga/Baichuan-13B-sft))。
|
| 249 |
+
|
| 250 |
+
[23/07/18] 我们开发了支持训练和测试的**浏览器一体化界面**。请使用 `train_web.py` 在您的浏览器中微调模型。感谢 [@KanadeSiina](https://github.com/KanadeSiina) 和 [@codemayq](https://github.com/codemayq) 在该功能开发中付出的努力。
|
| 251 |
+
|
| 252 |
+
[23/07/09] 我们开源了 **[FastEdit](https://github.com/hiyouga/FastEdit)** ⚡🩹,一个简单易用的、能迅速编辑大模型事实记忆的工具包。如果您感兴趣请关注我们的 [FastEdit](https://github.com/hiyouga/FastEdit) 项目。
|
| 253 |
+
|
| 254 |
+
[23/06/29] 我们提供了一个**可复现的**指令模型微调示例,详细内容请查阅 [Baichuan-7B-sft](https://huggingface.co/hiyouga/Baichuan-7B-sft)。
|
| 255 |
+
|
| 256 |
+
[23/06/22] 我们对齐了[示例 API](src/api_demo.py) 与 [OpenAI API](https://platform.openai.com/docs/api-reference/chat) 的格式,您可以将微调模型接入**任意基于 ChatGPT 的应用**中。
|
| 257 |
+
|
| 258 |
+
[23/06/03] 我们实现了 4 比特的 LoRA 训练(也称 **[QLoRA](https://github.com/artidoro/qlora)**)。详细用法请参照 [examples](examples/README_zh.md)。
|
| 259 |
+
|
| 260 |
+
</details>
|
| 261 |
+
|
| 262 |
+
> [!TIP]
|
| 263 |
+
> 如果您无法使用最新的功能,请尝试重新拉取代码并再次安装 LLaMA-Factory。
|
| 264 |
+
|
| 265 |
+
## 模型
|
| 266 |
+
|
| 267 |
+
| 模型名 | 参数量 | Template |
|
| 268 |
+
| ----------------------------------------------------------------- | -------------------------------- | -------------------- |
|
| 269 |
+
| [Baichuan 2](https://huggingface.co/baichuan-inc) | 7B/13B | baichuan2 |
|
| 270 |
+
| [BLOOM/BLOOMZ](https://huggingface.co/bigscience) | 560M/1.1B/1.7B/3B/7.1B/176B | - |
|
| 271 |
+
| [ChatGLM3](https://huggingface.co/THUDM) | 6B | chatglm3 |
|
| 272 |
+
| [Command R](https://huggingface.co/CohereForAI) | 35B/104B | cohere |
|
| 273 |
+
| [DeepSeek (Code/MoE)](https://huggingface.co/deepseek-ai) | 7B/16B/67B/236B | deepseek |
|
| 274 |
+
| [DeepSeek 2.5/3](https://huggingface.co/deepseek-ai) | 236B/671B | deepseek3 |
|
| 275 |
+
| [DeepSeek R1 (Distill)](https://huggingface.co/deepseek-ai) | 1.5B/7B/8B/14B/32B/70B/671B | deepseekr1 |
|
| 276 |
+
| [ERNIE-4.5](https://huggingface.co/baidu) | 0.3B/21B/300B | ernie/ernie_nothink |
|
| 277 |
+
| [Falcon](https://huggingface.co/tiiuae) | 7B/11B/40B/180B | falcon |
|
| 278 |
+
| [Falcon-H1](https://huggingface.co/tiiuae) | 0.5B/1.5B/3B/7B/34B | falcon_h1 |
|
| 279 |
+
| [Gemma/Gemma 2/CodeGemma](https://huggingface.co/google) | 2B/7B/9B/27B | gemma/gemma2 |
|
| 280 |
+
| [Gemma 3/Gemma 3n](https://huggingface.co/google) | 270M/1B/4B/6B/8B/12B/27B | gemma3/gemma3n |
|
| 281 |
+
| [GLM-4/GLM-4-0414/GLM-Z1](https://huggingface.co/zai-org) | 9B/32B | glm4/glmz1 |
|
| 282 |
+
| [GLM-4.1V](https://huggingface.co/zai-org) | 9B | glm4v |
|
| 283 |
+
| [GLM-4.5/GLM-4.5V](https://huggingface.co/zai-org) | 106B/355B | glm4_moe/glm4v_moe |
|
| 284 |
+
| [GPT-2](https://huggingface.co/openai-community) | 0.1B/0.4B/0.8B/1.5B | - |
|
| 285 |
+
| [GPT-OSS](https://huggingface.co/openai) | 20B/120B | gpt |
|
| 286 |
+
| [Granite 3.0-3.3](https://huggingface.co/ibm-granite) | 1B/2B/3B/8B | granite3 |
|
| 287 |
+
| [Granite 4](https://huggingface.co/ibm-granite) | 7B | granite4 |
|
| 288 |
+
| [Hunyuan (MT)](https://huggingface.co/tencent/) | 7B | hunyuan |
|
| 289 |
+
| [Index](https://huggingface.co/IndexTeam) | 1.9B | index |
|
| 290 |
+
| [InternLM 2-3](https://huggingface.co/internlm) | 7B/8B/20B | intern2 |
|
| 291 |
+
| [InternVL 2.5-3.5](https://huggingface.co/OpenGVLab) | 1B/2B/4B/8B/14B/30B/38B/78B/241B | intern_vl |
|
| 292 |
+
| [InternLM/Intern-S1-mini](https://huggingface.co/internlm/) | 8B | intern_s1 |
|
| 293 |
+
| [Kimi-VL](https://huggingface.co/moonshotai) | 16B | kimi_vl |
|
| 294 |
+
| [Ling 2.0 (mini/flash)](https://huggingface.co/inclusionAI) | 16B/100B | bailing_v2 |
|
| 295 |
+
| [Llama](https://github.com/facebookresearch/llama) | 7B/13B/33B/65B | - |
|
| 296 |
+
| [Llama 2](https://huggingface.co/meta-llama) | 7B/13B/70B | llama2 |
|
| 297 |
+
| [Llama 3-3.3](https://huggingface.co/meta-llama) | 1B/3B/8B/70B | llama3 |
|
| 298 |
+
| [Llama 4](https://huggingface.co/meta-llama) | 109B/402B | llama4 |
|
| 299 |
+
| [Llama 3.2 Vision](https://huggingface.co/meta-llama) | 11B/90B | mllama |
|
| 300 |
+
| [LLaVA-1.5](https://huggingface.co/llava-hf) | 7B/13B | llava |
|
| 301 |
+
| [LLaVA-NeXT](https://huggingface.co/llava-hf) | 7B/8B/13B/34B/72B/110B | llava_next |
|
| 302 |
+
| [LLaVA-NeXT-Video](https://huggingface.co/llava-hf) | 7B/34B | llava_next_video |
|
| 303 |
+
| [MiMo](https://huggingface.co/XiaomiMiMo) | 7B | mimo |
|
| 304 |
+
| [MiniCPM 1-4.1](https://huggingface.co/openbmb) | 0.5B/1B/2B/4B/8B | cpm/cpm3/cpm4 |
|
| 305 |
+
| [MiniCPM-o-2.6/MiniCPM-V-2.6](https://huggingface.co/openbmb) | 8B | minicpm_o/minicpm_v |
|
| 306 |
+
| [Ministral/Mistral-Nemo](https://huggingface.co/mistralai) | 8B/12B | ministral |
|
| 307 |
+
| [Mistral/Mixtral](https://huggingface.co/mistralai) | 7B/8x7B/8x22B | mistral |
|
| 308 |
+
| [Mistral Small](https://huggingface.co/mistralai) | 24B | mistral_small |
|
| 309 |
+
| [OLMo](https://huggingface.co/allenai) | 1B/7B | - |
|
| 310 |
+
| [PaliGemma/PaliGemma2](https://huggingface.co/google) | 3B/10B/28B | paligemma |
|
| 311 |
+
| [Phi-1.5/Phi-2](https://huggingface.co/microsoft) | 1.3B/2.7B | - |
|
| 312 |
+
| [Phi-3/Phi-3.5](https://huggingface.co/microsoft) | 4B/14B | phi |
|
| 313 |
+
| [Phi-3-small](https://huggingface.co/microsoft) | 7B | phi_small |
|
| 314 |
+
| [Phi-4](https://huggingface.co/microsoft) | 14B | phi4 |
|
| 315 |
+
| [Pixtral](https://huggingface.co/mistralai) | 12B | pixtral |
|
| 316 |
+
| [Qwen (1-2.5) (Code/Math/MoE/QwQ)](https://huggingface.co/Qwen) | 0.5B/1.5B/3B/7B/14B/32B/72B/110B | qwen |
|
| 317 |
+
| [Qwen3 (MoE/Instruct/Thinking/Next)](https://huggingface.co/Qwen) | 0.6B/1.7B/4B/8B/14B/32B/80B/235B | qwen3/qwen3_nothink |
|
| 318 |
+
| [Qwen2-Audio](https://huggingface.co/Qwen) | 7B | qwen2_audio |
|
| 319 |
+
| [Qwen2.5-Omni](https://huggingface.co/Qwen) | 3B/7B | qwen2_omni |
|
| 320 |
+
| [Qwen3-Omni](https://huggingface.co/Qwen) | 30B | qwen3_omni |
|
| 321 |
+
| [Qwen2-VL/Qwen2.5-VL/QVQ](https://huggingface.co/Qwen) | 2B/3B/7B/32B/72B | qwen2_vl |
|
| 322 |
+
| [Qwen3-VL](https://huggingface.co/Qwen) | 2B/4B/8B/30B/32B/235B | qwen3_vl |
|
| 323 |
+
| [Seed (OSS/Coder)](https://huggingface.co/ByteDance-Seed) | 8B/36B | seed_oss/seed_coder |
|
| 324 |
+
| [Skywork o1](https://huggingface.co/Skywork) | 8B | skywork_o1 |
|
| 325 |
+
| [StarCoder 2](https://huggingface.co/bigcode) | 3B/7B/15B | - |
|
| 326 |
+
| [TeleChat2](https://huggingface.co/Tele-AI) | 3B/7B/35B/115B | telechat2 |
|
| 327 |
+
| [XVERSE](https://huggingface.co/xverse) | 7B/13B/65B | xverse |
|
| 328 |
+
| [Yi/Yi-1.5 (Code)](https://huggingface.co/01-ai) | 1.5B/6B/9B/34B | yi |
|
| 329 |
+
| [Yi-VL](https://huggingface.co/01-ai) | 6B/34B | yi_vl |
|
| 330 |
+
| [Yuan 2](https://huggingface.co/IEITYuan) | 2B/51B/102B | yuan |
|
| 331 |
+
|
| 332 |
+
> [!NOTE]
|
| 333 |
+
> 对于所有“基座”(Base)模型,`template` 参数可以是 `default`, `alpaca`, `vicuna` 等任意值。但“对话”(Instruct/Chat)模型请务必使用**对应的模板**。
|
| 334 |
+
>
|
| 335 |
+
> 请务必在训练和���理时采用**完全一致**的模板。
|
| 336 |
+
>
|
| 337 |
+
> \*:您需要从 main 分支安装 `transformers` 并使用 `DISABLE_VERSION_CHECK=1` 来跳过版本检查。
|
| 338 |
+
>
|
| 339 |
+
> \*\*:您需要安装特定版本的 `transformers` 以使用该模型。
|
| 340 |
+
|
| 341 |
+
项目所支持模型的完整列表请参阅 [constants.py](src/llamafactory/extras/constants.py)。
|
| 342 |
+
|
| 343 |
+
您也可以在 [template.py](src/llamafactory/data/template.py) 中添加自己的对话模板。
|
| 344 |
+
|
| 345 |
+
## 训练方法
|
| 346 |
+
|
| 347 |
+
| 方法 | 全参数训练 | 部分参数训练 | LoRA | QLoRA |
|
| 348 |
+
| --------------------- | ------------------ | ------------------ | ------------------ | ------------------ |
|
| 349 |
+
| 预训练 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|
| 350 |
+
| 指令监督微调 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|
| 351 |
+
| 奖励模型训练 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|
| 352 |
+
| PPO 训练 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|
| 353 |
+
| DPO 训练 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|
| 354 |
+
| KTO 训练 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|
| 355 |
+
| ORPO 训练 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|
| 356 |
+
| SimPO 训练 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
|
| 357 |
+
|
| 358 |
+
> [!TIP]
|
| 359 |
+
> 有关 PPO 的实现细节,请参考[此博客](https://newfacade.github.io/notes-on-reinforcement-learning/17-ppo-trl.html)。
|
| 360 |
+
|
| 361 |
+
## 数据集
|
| 362 |
+
|
| 363 |
+
<details><summary>预训练数据集</summary>
|
| 364 |
+
|
| 365 |
+
- [Wiki Demo (en)](data/wiki_demo.txt)
|
| 366 |
+
- [RefinedWeb (en)](https://huggingface.co/datasets/tiiuae/falcon-refinedweb)
|
| 367 |
+
- [RedPajama V2 (en)](https://huggingface.co/datasets/togethercomputer/RedPajama-Data-V2)
|
| 368 |
+
- [Wikipedia (en)](https://huggingface.co/datasets/olm/olm-wikipedia-20221220)
|
| 369 |
+
- [Wikipedia (zh)](https://huggingface.co/datasets/pleisto/wikipedia-cn-20230720-filtered)
|
| 370 |
+
- [Pile (en)](https://huggingface.co/datasets/EleutherAI/pile)
|
| 371 |
+
- [SkyPile (zh)](https://huggingface.co/datasets/Skywork/SkyPile-150B)
|
| 372 |
+
- [FineWeb (en)](https://huggingface.co/datasets/HuggingFaceFW/fineweb)
|
| 373 |
+
- [FineWeb-Edu (en)](https://huggingface.co/datasets/HuggingFaceFW/fineweb-edu)
|
| 374 |
+
- [CCI3-HQ (zh)](https://huggingface.co/datasets/BAAI/CCI3-HQ)
|
| 375 |
+
- [CCI3-Data (zh)](https://huggingface.co/datasets/BAAI/CCI3-Data)
|
| 376 |
+
- [CCI4.0-M2-Base-v1 (en&zh)](https://huggingface.co/datasets/BAAI/CCI4.0-M2-Base-v1)
|
| 377 |
+
- [CCI4.0-M2-CoT-v1 (en&zh)](https://huggingface.co/datasets/BAAI/CCI4.0-M2-CoT-v1)
|
| 378 |
+
- [CCI4.0-M2-Extra-v1 (en&zh)](https://huggingface.co/datasets/BAAI/CCI4.0-M2-Extra-v1)
|
| 379 |
+
- [The Stack (en)](https://huggingface.co/datasets/bigcode/the-stack)
|
| 380 |
+
- [StarCoder (en)](https://huggingface.co/datasets/bigcode/starcoderdata)
|
| 381 |
+
|
| 382 |
+
</details>
|
| 383 |
+
|
| 384 |
+
<details><summary>指令微调数据集</summary>
|
| 385 |
+
|
| 386 |
+
- [Identity (en&zh)](data/identity.json)
|
| 387 |
+
- [Stanford Alpaca (en)](https://github.com/tatsu-lab/stanford_alpaca)
|
| 388 |
+
- [Stanford Alpaca (zh)](https://github.com/ymcui/Chinese-LLaMA-Alpaca-3)
|
| 389 |
+
- [Alpaca GPT4 (en&zh)](https://github.com/Instruction-Tuning-with-GPT-4/GPT-4-LLM)
|
| 390 |
+
- [Glaive Function Calling V2 (en&zh)](https://huggingface.co/datasets/glaiveai/glaive-function-calling-v2)
|
| 391 |
+
- [LIMA (en)](https://huggingface.co/datasets/GAIR/lima)
|
| 392 |
+
- [Guanaco Dataset (multilingual)](https://huggingface.co/datasets/JosephusCheung/GuanacoDataset)
|
| 393 |
+
- [BELLE 2M (zh)](https://huggingface.co/datasets/BelleGroup/train_2M_CN)
|
| 394 |
+
- [BELLE 1M (zh)](https://huggingface.co/datasets/BelleGroup/train_1M_CN)
|
| 395 |
+
- [BELLE 0.5M (zh)](https://huggingface.co/datasets/BelleGroup/train_0.5M_CN)
|
| 396 |
+
- [BELLE Dialogue 0.4M (zh)](https://huggingface.co/datasets/BelleGroup/generated_chat_0.4M)
|
| 397 |
+
- [BELLE School Math 0.25M (zh)](https://huggingface.co/datasets/BelleGroup/school_math_0.25M)
|
| 398 |
+
- [BELLE Multiturn Chat 0.8M (zh)](https://huggingface.co/datasets/BelleGroup/multiturn_chat_0.8M)
|
| 399 |
+
- [UltraChat (en)](https://github.com/thunlp/UltraChat)
|
| 400 |
+
- [OpenPlatypus (en)](https://huggingface.co/datasets/garage-bAInd/Open-Platypus)
|
| 401 |
+
- [CodeAlpaca 20k (en)](https://huggingface.co/datasets/sahil2801/CodeAlpaca-20k)
|
| 402 |
+
- [Alpaca CoT (multilingual)](https://huggingface.co/datasets/QingyiSi/Alpaca-CoT)
|
| 403 |
+
- [OpenOrca (en)](https://huggingface.co/datasets/Open-Orca/OpenOrca)
|
| 404 |
+
- [SlimOrca (en)](https://huggingface.co/datasets/Open-Orca/SlimOrca)
|
| 405 |
+
- [MathInstruct (en)](https://huggingface.co/datasets/TIGER-Lab/MathInstruct)
|
| 406 |
+
- [Firefly 1.1M (zh)](https://huggingface.co/datasets/YeungNLP/firefly-train-1.1M)
|
| 407 |
+
- [Wiki QA (en)](https://huggingface.co/datasets/wiki_qa)
|
| 408 |
+
- [Web QA (zh)](https://huggingface.co/datasets/suolyer/webqa)
|
| 409 |
+
- [WebNovel (zh)](https://huggingface.co/datasets/zxbsmk/webnovel_cn)
|
| 410 |
+
- [Nectar (en)](https://huggingface.co/datasets/berkeley-nest/Nectar)
|
| 411 |
+
- [deepctrl (en&zh)](https://www.modelscope.cn/datasets/deepctrl/deepctrl-sft-data)
|
| 412 |
+
- [Advertise Generating (zh)](https://huggingface.co/datasets/HasturOfficial/adgen)
|
| 413 |
+
- [ShareGPT Hyperfiltered (en)](https://huggingface.co/datasets/totally-not-an-llm/sharegpt-hyperfiltered-3k)
|
| 414 |
+
- [ShareGPT4 (en&zh)](https://huggingface.co/datasets/shibing624/sharegpt_gpt4)
|
| 415 |
+
- [UltraChat 200k (en)](https://huggingface.co/datasets/HuggingFaceH4/ultrachat_200k)
|
| 416 |
+
- [Infinity Instruct (zh)](https://huggingface.co/datasets/BAAI/Infinity-Instruct)
|
| 417 |
+
- [AgentInstruct (en)](https://huggingface.co/datasets/THUDM/AgentInstruct)
|
| 418 |
+
- [LMSYS Chat 1M (en)](https://huggingface.co/datasets/lmsys/lmsys-chat-1m)
|
| 419 |
+
- [Evol Instruct V2 (en)](https://huggingface.co/datasets/WizardLM/WizardLM_evol_instruct_V2_196k)
|
| 420 |
+
- [Cosmopedia (en)](https://huggingface.co/datasets/HuggingFaceTB/cosmopedia)
|
| 421 |
+
- [STEM (zh)](https://huggingface.co/datasets/hfl/stem_zh_instruction)
|
| 422 |
+
- [Ruozhiba (zh)](https://huggingface.co/datasets/hfl/ruozhiba_gpt4_turbo)
|
| 423 |
+
- [Neo-sft (zh)](https://huggingface.co/datasets/m-a-p/neo_sft_phase2)
|
| 424 |
+
- [Magpie-Pro-300K-Filtered (en)](https://huggingface.co/datasets/Magpie-Align/Magpie-Pro-300K-Filtered)
|
| 425 |
+
- [Magpie-ultra-v0.1 (en)](https://huggingface.co/datasets/argilla/magpie-ultra-v0.1)
|
| 426 |
+
- [WebInstructSub (en)](https://huggingface.co/datasets/TIGER-Lab/WebInstructSub)
|
| 427 |
+
- [OpenO1-SFT (en&zh)](https://huggingface.co/datasets/O1-OPEN/OpenO1-SFT)
|
| 428 |
+
- [Open-Thoughts (en)](https://huggingface.co/datasets/open-thoughts/OpenThoughts-114k)
|
| 429 |
+
- [Open-R1-Math (en)](https://huggingface.co/datasets/open-r1/OpenR1-Math-220k)
|
| 430 |
+
- [Chinese-DeepSeek-R1-Distill (zh)](https://huggingface.co/datasets/Congliu/Chinese-DeepSeek-R1-Distill-data-110k-SFT)
|
| 431 |
+
- [LLaVA mixed (en&zh)](https://huggingface.co/datasets/BUAADreamer/llava-en-zh-300k)
|
| 432 |
+
- [Pokemon-gpt4o-captions (en&zh)](https://huggingface.co/datasets/jugg1024/pokemon-gpt4o-captions)
|
| 433 |
+
- [Open Assistant (de)](https://huggingface.co/datasets/mayflowergmbh/oasst_de)
|
| 434 |
+
- [Dolly 15k (de)](https://huggingface.co/datasets/mayflowergmbh/dolly-15k_de)
|
| 435 |
+
- [Alpaca GPT4 (de)](https://huggingface.co/datasets/mayflowergmbh/alpaca-gpt4_de)
|
| 436 |
+
- [OpenSchnabeltier (de)](https://huggingface.co/datasets/mayflowergmbh/openschnabeltier_de)
|
| 437 |
+
- [Evol Instruct (de)](https://huggingface.co/datasets/mayflowergmbh/evol-instruct_de)
|
| 438 |
+
- [Dolphin (de)](https://huggingface.co/datasets/mayflowergmbh/dolphin_de)
|
| 439 |
+
- [Booksum (de)](https://huggingface.co/datasets/mayflowergmbh/booksum_de)
|
| 440 |
+
- [Airoboros (de)](https://huggingface.co/datasets/mayflowergmbh/airoboros-3.0_de)
|
| 441 |
+
- [Ultrachat (de)](https://huggingface.co/datasets/mayflowergmbh/ultra-chat_de)
|
| 442 |
+
|
| 443 |
+
</details>
|
| 444 |
+
|
| 445 |
+
<details><summary>偏好数据集</summary>
|
| 446 |
+
|
| 447 |
+
- [DPO mixed (en&zh)](https://huggingface.co/datasets/hiyouga/DPO-En-Zh-20k)
|
| 448 |
+
- [UltraFeedback (en)](https://huggingface.co/datasets/HuggingFaceH4/ultrafeedback_binarized)
|
| 449 |
+
- [COIG-P (zh)](https://huggingface.co/datasets/m-a-p/COIG-P)
|
| 450 |
+
- [RLHF-V (en)](https://huggingface.co/datasets/openbmb/RLHF-V-Dataset)
|
| 451 |
+
- [VLFeedback (en)](https://huggingface.co/datasets/Zhihui/VLFeedback)
|
| 452 |
+
- [RLAIF-V (en)](https://huggingface.co/datasets/openbmb/RLAIF-V-Dataset)
|
| 453 |
+
- [Orca DPO Pairs (en)](https://huggingface.co/datasets/Intel/orca_dpo_pairs)
|
| 454 |
+
- [HH-RLHF (en)](https://huggingface.co/datasets/Anthropic/hh-rlhf)
|
| 455 |
+
- [Nectar (en)](https://huggingface.co/datasets/berkeley-nest/Nectar)
|
| 456 |
+
- [Orca DPO (de)](https://huggingface.co/datasets/mayflowergmbh/intel_orca_dpo_pairs_de)
|
| 457 |
+
- [KTO mixed (en)](https://huggingface.co/datasets/argilla/kto-mix-15k)
|
| 458 |
+
|
| 459 |
+
</details>
|
| 460 |
+
|
| 461 |
+
部分数据集的使用需要确认,我们推荐使用下述命令登录您的 Hugging Face 账户。
|
| 462 |
+
|
| 463 |
+
```bash
|
| 464 |
+
pip install --upgrade huggingface_hub
|
| 465 |
+
huggingface-cli login
|
| 466 |
+
```
|
| 467 |
+
|
| 468 |
+
## 软硬件依赖
|
| 469 |
+
|
| 470 |
+
| 必需项 | 至少 | 推荐 |
|
| 471 |
+
| ------------ | ------- | --------- |
|
| 472 |
+
| python | 3.9 | 3.10 |
|
| 473 |
+
| torch | 2.0.0 | 2.6.0 |
|
| 474 |
+
| torchvision | 0.15.0 | 0.21.0 |
|
| 475 |
+
| transformers | 4.49.0 | 4.50.0 |
|
| 476 |
+
| datasets | 2.16.0 | 3.2.0 |
|
| 477 |
+
| accelerate | 0.34.0 | 1.2.1 |
|
| 478 |
+
| peft | 0.14.0 | 0.15.1 |
|
| 479 |
+
| trl | 0.8.6 | 0.9.6 |
|
| 480 |
+
|
| 481 |
+
| 可选项 | 至少 | 推荐 |
|
| 482 |
+
| ------------ | ------- | --------- |
|
| 483 |
+
| CUDA | 11.6 | 12.2 |
|
| 484 |
+
| deepspeed | 0.10.0 | 0.16.4 |
|
| 485 |
+
| bitsandbytes | 0.39.0 | 0.43.1 |
|
| 486 |
+
| vllm | 0.4.3 | 0.8.2 |
|
| 487 |
+
| flash-attn | 2.5.6 | 2.7.2 |
|
| 488 |
+
|
| 489 |
+
### 硬件依赖
|
| 490 |
+
|
| 491 |
+
\* *估算值*
|
| 492 |
+
|
| 493 |
+
| 方法 | 精度 | 7B | 14B | 30B | 70B | `x`B |
|
| 494 |
+
| ------------------------------- | ---- | ----- | ----- | ----- | ------ | ------- |
|
| 495 |
+
| Full (`bf16` or `fp16`) | 32 | 120GB | 240GB | 600GB | 1200GB | `18x`GB |
|
| 496 |
+
| Full (`pure_bf16`) | 16 | 60GB | 120GB | 300GB | 600GB | `8x`GB |
|
| 497 |
+
| Freeze/LoRA/GaLore/APOLLO/BAdam | 16 | 16GB | 32GB | 64GB | 160GB | `2x`GB |
|
| 498 |
+
| QLoRA | 8 | 10GB | 20GB | 40GB | 80GB | `x`GB |
|
| 499 |
+
| QLoRA | 4 | 6GB | 12GB | 24GB | 48GB | `x/2`GB |
|
| 500 |
+
| QLoRA | 2 | 4GB | 8GB | 16GB | 24GB | `x/4`GB |
|
| 501 |
+
|
| 502 |
+
## 如何使用
|
| 503 |
+
|
| 504 |
+
### 安装 LLaMA Factory
|
| 505 |
+
|
| 506 |
+
> [!IMPORTANT]
|
| 507 |
+
> 此步骤为必需。
|
| 508 |
+
|
| 509 |
+
#### 从源码安装
|
| 510 |
+
|
| 511 |
+
```bash
|
| 512 |
+
git clone --depth 1 https://github.com/hiyouga/LLaMA-Factory.git
|
| 513 |
+
cd LLaMA-Factory
|
| 514 |
+
pip install -e ".[torch,metrics]" --no-build-isolation
|
| 515 |
+
```
|
| 516 |
+
|
| 517 |
+
可选的额外依赖项:torch、torch-npu、metrics、deepspeed、liger-kernel、bitsandbytes、hqq、eetq、gptq、aqlm、vllm、sglang、galore、apollo、badam、adam-mini、qwen、minicpm_v、openmind、swanlab、dev
|
| 518 |
+
|
| 519 |
+
#### 从镜像安装
|
| 520 |
+
|
| 521 |
+
```bash
|
| 522 |
+
docker run -it --rm --gpus=all --ipc=host hiyouga/llamafactory:latest
|
| 523 |
+
```
|
| 524 |
+
|
| 525 |
+
该镜像基于 Ubuntu 22.04(x86\_64)、CUDA 12.4、Python 3.11、PyTorch 2.6.0 和 Flash-attn 2.7.4 构建。
|
| 526 |
+
|
| 527 |
+
查看全部镜像:https://hub.docker.com/r/hiyouga/llamafactory/tags
|
| 528 |
+
|
| 529 |
+
请参阅[构建 Docker](#构建-docker) 来重新构建镜像。
|
| 530 |
+
|
| 531 |
+
<details><summary>使用 <b>uv</b> 构建虚拟环境</summary>
|
| 532 |
+
|
| 533 |
+
使用 [uv](https://github.com/astral-sh/uv) 创建隔离的 Python 环境:
|
| 534 |
+
|
| 535 |
+
```bash
|
| 536 |
+
uv sync --extra torch --extra metrics --prerelease=allow
|
| 537 |
+
```
|
| 538 |
+
|
| 539 |
+
在环境中运行 LLaMA-Factory:
|
| 540 |
+
|
| 541 |
+
```bash
|
| 542 |
+
uv run --prerelease=allow llamafactory-cli train examples/train_lora/llama3_lora_pretrain.yaml
|
| 543 |
+
```
|
| 544 |
+
|
| 545 |
+
</details>
|
| 546 |
+
|
| 547 |
+
<details><summary>Windows 用户指南</summary>
|
| 548 |
+
|
| 549 |
+
#### 安装 PyTorch
|
| 550 |
+
|
| 551 |
+
Windows 平台需要额外手动安装 GPU 版本的 PyTorch 依赖包,您可以参考[官方网站](https://pytorch.org/get-started/locally/)和以下命令安装并测试 PyTorch 是否正确安装。
|
| 552 |
+
|
| 553 |
+
```bash
|
| 554 |
+
pip uninstall torch torchvision torchaudio
|
| 555 |
+
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu126
|
| 556 |
+
python -c "import torch; print(torch.cuda.is_available())"
|
| 557 |
+
```
|
| 558 |
+
|
| 559 |
+
如果看到 `True` 则说明安装成功。
|
| 560 |
+
|
| 561 |
+
若遇到类似 `Can't pickle local object` 的报错,请设置 `dataloader_num_workers: 0`。
|
| 562 |
+
|
| 563 |
+
#### 安装 BitsAndBytes
|
| 564 |
+
|
| 565 |
+
如果要在 Windows 平台上开启量化 LoRA(QLoRA),需要安装预编译的 `bitsandbytes` 库, 支持 CUDA 11.1 到 12.2, 请根据您的 CUDA 版本情况选择适合的[发布版本](https://github.com/jllllll/bitsandbytes-windows-webui/releases/tag/wheels)。
|
| 566 |
+
|
| 567 |
+
```bash
|
| 568 |
+
pip install https://github.com/jllllll/bitsandbytes-windows-webui/releases/download/wheels/bitsandbytes-0.41.2.post2-py3-none-win_amd64.whl
|
| 569 |
+
```
|
| 570 |
+
|
| 571 |
+
#### 安装 Flash Attention-2
|
| 572 |
+
|
| 573 |
+
如果要在 Windows 平台上开启 FlashAttention-2,请使用 [flash-attention-windows-wheel](https://huggingface.co/lldacing/flash-attention-windows-wheel) 中的脚本自行编译与安装。
|
| 574 |
+
|
| 575 |
+
</details>
|
| 576 |
+
|
| 577 |
+
<details><summary>昇腾 NPU 用户指南</summary>
|
| 578 |
+
|
| 579 |
+
在昇腾 NPU 设备上安装 LLaMA Factory 时,请升级 Python 到 3.10 及以上,并需要指定额外依赖项,使用 `pip install -e ".[torch-npu,metrics]"` 命令安装。此外,还需要安装 **[Ascend CANN Toolkit 与 Kernels](https://www.hiascend.com/developer/download/community/result?module=cann)**,安装方法请参考[安装教程](https://www.hiascend.com/document/detail/zh/CANNCommunityEdition/80RC2alpha002/quickstart/quickstart/quickstart_18_0004.html)或使用以下命令:
|
| 580 |
+
|
| 581 |
+
```bash
|
| 582 |
+
# 请替换 URL 为 CANN 版本和设备型号对应的 URL
|
| 583 |
+
# 安装 CANN Toolkit
|
| 584 |
+
wget https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Milan-ASL/Milan-ASL%20V100R001C17SPC701/Ascend-cann-toolkit_8.0.RC1.alpha001_linux-"$(uname -i)".run
|
| 585 |
+
bash Ascend-cann-toolkit_8.0.RC1.alpha001_linux-"$(uname -i)".run --install
|
| 586 |
+
|
| 587 |
+
# 安装 CANN Kernels
|
| 588 |
+
wget https://ascend-repo.obs.cn-east-2.myhuaweicloud.com/Milan-ASL/Milan-ASL%20V100R001C17SPC701/Ascend-cann-kernels-910b_8.0.RC1.alpha001_linux.run
|
| 589 |
+
bash Ascend-cann-kernels-910b_8.0.RC1.alpha001_linux.run --install
|
| 590 |
+
|
| 591 |
+
# 设置环境变量
|
| 592 |
+
source /usr/local/Ascend/ascend-toolkit/set_env.sh
|
| 593 |
+
```
|
| 594 |
+
|
| 595 |
+
| 依赖项 | 至少 | 推荐 |
|
| 596 |
+
| ------------ | ------- | -------------- |
|
| 597 |
+
| CANN | 8.0.RC1 | 8.0.0.alpha002 |
|
| 598 |
+
| torch | 2.1.0 | 2.4.0 |
|
| 599 |
+
| torch-npu | 2.1.0 | 2.4.0.post2 |
|
| 600 |
+
| deepspeed | 0.13.2 | 0.13.2 |
|
| 601 |
+
| vllm-ascend | - | 0.7.3 |
|
| 602 |
+
|
| 603 |
+
请使用 `ASCEND_RT_VISIBLE_DEVICES` 而非 `CUDA_VISIBLE_DEVICES` 来指定运算设备。
|
| 604 |
+
|
| 605 |
+
如果遇到无法正常推理的情况,请尝试设置 `do_sample: false`。
|
| 606 |
+
|
| 607 |
+
下载预构建 Docker 镜像:[32GB](http://mirrors.cn-central-221.ovaijisuan.com/detail/130.html) | [64GB](http://mirrors.cn-central-221.ovaijisuan.com/detail/131.html)
|
| 608 |
+
|
| 609 |
+
#### 安装 BitsAndBytes
|
| 610 |
+
|
| 611 |
+
如果要在 Ascend NPU 上进行基于 bitsandbytes 的 QLoRA 量化微调,请执行如下步骤:
|
| 612 |
+
|
| 613 |
+
1. 手动编译 bitsandbytes:请参考[安装文档](https://huggingface.co/docs/bitsandbytes/installation?backend=Ascend+NPU&platform=Ascend+NPU)完成 NPU 版的 bitsandbytes 安装,编译要求环境 cmake 版本不低于 3.22.1,g++ 版本不低于 12.x。
|
| 614 |
+
|
| 615 |
+
```bash
|
| 616 |
+
# 从源码安装 bitsandbytes
|
| 617 |
+
# 克隆 bitsandbytes 仓库, Ascend NPU 目前在 multi-backend-refactor 中支持
|
| 618 |
+
git clone -b multi-backend-refactor https://github.com/bitsandbytes-foundation/bitsandbytes.git
|
| 619 |
+
cd bitsandbytes/
|
| 620 |
+
|
| 621 |
+
# 安装依赖
|
| 622 |
+
pip install -r requirements-dev.txt
|
| 623 |
+
|
| 624 |
+
# 安装编译工具依赖,该步骤在不同系统上命令有所不同,供参考
|
| 625 |
+
apt-get install -y build-essential cmake
|
| 626 |
+
|
| 627 |
+
# 编译 & 安装
|
| 628 |
+
cmake -DCOMPUTE_BACKEND=npu -S .
|
| 629 |
+
make
|
| 630 |
+
pip install .
|
| 631 |
+
```
|
| 632 |
+
|
| 633 |
+
2. 安装 transformers 的 main 分支版本。
|
| 634 |
+
|
| 635 |
+
```bash
|
| 636 |
+
git clone -b main https://github.com/huggingface/transformers.git
|
| 637 |
+
cd transformers
|
| 638 |
+
pip install .
|
| 639 |
+
```
|
| 640 |
+
|
| 641 |
+
3. 在训练参数中设置 `double_quantization: false`,可参考[示例](examples/train_qlora/llama3_lora_sft_bnb_npu.yaml)。
|
| 642 |
+
|
| 643 |
+
</details>
|
| 644 |
+
|
| 645 |
+
### 数据准备
|
| 646 |
+
|
| 647 |
+
关于数据集文件的格式,请参考 [data/README_zh.md](data/README_zh.md) 的内容。你可以使用 HuggingFace / ModelScope / Modelers 上的数据集或加载本地数据集。
|
| 648 |
+
|
| 649 |
+
> [!NOTE]
|
| 650 |
+
> 使用自定义数据集时,请更新 `data/dataset_info.json` 文件。
|
| 651 |
+
|
| 652 |
+
您也可以使用 **[Easy Dataset](https://github.com/ConardLi/easy-dataset)**、**[DataFlow](https://github.com/OpenDCAI/DataFlow)** 和 **[GraphGen](https://github.com/open-sciencelab/GraphGen)** 构建用于微调的合成数据。
|
| 653 |
+
|
| 654 |
+
### 快速开始
|
| 655 |
+
|
| 656 |
+
下面三行命令分别对 Llama3-8B-Instruct 模型进行 LoRA **微调**、**推理**和**合并**。
|
| 657 |
+
|
| 658 |
+
```bash
|
| 659 |
+
llamafactory-cli train examples/train_lora/llama3_lora_sft.yaml
|
| 660 |
+
llamafactory-cli chat examples/inference/llama3_lora_sft.yaml
|
| 661 |
+
llamafactory-cli export examples/merge_lora/llama3_lora_sft.yaml
|
| 662 |
+
```
|
| 663 |
+
|
| 664 |
+
高级用法请参考 [examples/README_zh.md](examples/README_zh.md)(包括多 GPU 微调)。
|
| 665 |
+
|
| 666 |
+
> [!TIP]
|
| 667 |
+
> 使用 `llamafactory-cli help` 显示帮助信息。
|
| 668 |
+
>
|
| 669 |
+
> 遇到报错请先看[常见问题](https://github.com/hiyouga/LLaMA-Factory/issues/4614)。
|
| 670 |
+
|
| 671 |
+
### LLaMA Board 可视化微调(由 [Gradio](https://github.com/gradio-app/gradio) 驱动)
|
| 672 |
+
|
| 673 |
+
```bash
|
| 674 |
+
llamafactory-cli webui
|
| 675 |
+
```
|
| 676 |
+
|
| 677 |
+
### LLaMA Factory Online 在线微调
|
| 678 |
+
|
| 679 |
+
详情阅读该[文档](https://docs.llamafactory.com.cn/docs/documents/quickstart/getstarted/?utm_source=LLaMA-Factory)。
|
| 680 |
+
|
| 681 |
+
### 构建 Docker
|
| 682 |
+
|
| 683 |
+
CUDA 用户:
|
| 684 |
+
|
| 685 |
+
```bash
|
| 686 |
+
cd docker/docker-cuda/
|
| 687 |
+
docker compose up -d
|
| 688 |
+
docker compose exec llamafactory bash
|
| 689 |
+
```
|
| 690 |
+
|
| 691 |
+
昇腾 NPU 用户:
|
| 692 |
+
|
| 693 |
+
```bash
|
| 694 |
+
cd docker/docker-npu/
|
| 695 |
+
docker compose up -d
|
| 696 |
+
docker compose exec llamafactory bash
|
| 697 |
+
```
|
| 698 |
+
|
| 699 |
+
AMD ROCm 用户:
|
| 700 |
+
|
| 701 |
+
```bash
|
| 702 |
+
cd docker/docker-rocm/
|
| 703 |
+
docker compose up -d
|
| 704 |
+
docker compose exec llamafactory bash
|
| 705 |
+
```
|
| 706 |
+
|
| 707 |
+
<details><summary>不使用 Docker Compose 构建</summary>
|
| 708 |
+
|
| 709 |
+
CUDA 用户:
|
| 710 |
+
|
| 711 |
+
```bash
|
| 712 |
+
docker build -f ./docker/docker-cuda/Dockerfile \
|
| 713 |
+
--build-arg PIP_INDEX=https://pypi.org/simple \
|
| 714 |
+
--build-arg EXTRAS=metrics \
|
| 715 |
+
-t llamafactory:latest .
|
| 716 |
+
|
| 717 |
+
docker run -dit --ipc=host --gpus=all \
|
| 718 |
+
-p 7860:7860 \
|
| 719 |
+
-p 8000:8000 \
|
| 720 |
+
--name llamafactory \
|
| 721 |
+
llamafactory:latest
|
| 722 |
+
|
| 723 |
+
docker exec -it llamafactory bash
|
| 724 |
+
```
|
| 725 |
+
|
| 726 |
+
昇腾 NPU 用户:
|
| 727 |
+
|
| 728 |
+
```bash
|
| 729 |
+
docker build -f ./docker/docker-npu/Dockerfile \
|
| 730 |
+
--build-arg PIP_INDEX=https://pypi.org/simple \
|
| 731 |
+
--build-arg EXTRAS=torch-npu,metrics \
|
| 732 |
+
-t llamafactory:latest .
|
| 733 |
+
|
| 734 |
+
docker run -dit --ipc=host \
|
| 735 |
+
-v /usr/local/dcmi:/usr/local/dcmi \
|
| 736 |
+
-v /usr/local/bin/npu-smi:/usr/local/bin/npu-smi \
|
| 737 |
+
-v /usr/local/Ascend/driver:/usr/local/Ascend/driver \
|
| 738 |
+
-v /etc/ascend_install.info:/etc/ascend_install.info \
|
| 739 |
+
-p 7860:7860 \
|
| 740 |
+
-p 8000:8000 \
|
| 741 |
+
--device /dev/davinci0 \
|
| 742 |
+
--device /dev/davinci_manager \
|
| 743 |
+
--device /dev/devmm_svm \
|
| 744 |
+
--device /dev/hisi_hdc \
|
| 745 |
+
--name llamafactory \
|
| 746 |
+
llamafactory:latest
|
| 747 |
+
|
| 748 |
+
docker exec -it llamafactory bash
|
| 749 |
+
```
|
| 750 |
+
|
| 751 |
+
AMD ROCm 用户:
|
| 752 |
+
|
| 753 |
+
```bash
|
| 754 |
+
docker build -f ./docker/docker-rocm/Dockerfile \
|
| 755 |
+
--build-arg PIP_INDEX=https://pypi.org/simple \
|
| 756 |
+
--build-arg EXTRAS=metrics \
|
| 757 |
+
-t llamafactory:latest .
|
| 758 |
+
|
| 759 |
+
docker run -dit --ipc=host \
|
| 760 |
+
-p 7860:7860 \
|
| 761 |
+
-p 8000:8000 \
|
| 762 |
+
--device /dev/kfd \
|
| 763 |
+
--device /dev/dri \
|
| 764 |
+
--name llamafactory \
|
| 765 |
+
llamafactory:latest
|
| 766 |
+
|
| 767 |
+
docker exec -it llamafactory bash
|
| 768 |
+
```
|
| 769 |
+
|
| 770 |
+
</details>
|
| 771 |
+
|
| 772 |
+
<details><summary>使用数据卷</summary>
|
| 773 |
+
|
| 774 |
+
您可以通过移除 Dockerfile 中 `VOLUME [ "/root/.cache/huggingface", "/app/shared_data", "/app/output" ]` 的注释来使用数据卷。
|
| 775 |
+
|
| 776 |
+
在构建 Docker 时使用参数 `-v ./hf_cache:/root/.cache/huggingface` 来挂载数据卷。各个数据卷的含义表示如下。
|
| 777 |
+
|
| 778 |
+
- `hf_cache`:使用宿主机的 Hugging Face 缓存文件夹。
|
| 779 |
+
- `shared_data`:宿主机中存放数据集的文件夹路径。
|
| 780 |
+
- `output`:将导出目录设置为该路径后,即可在宿主机中访问导出后的模型。
|
| 781 |
+
|
| 782 |
+
</details>
|
| 783 |
+
|
| 784 |
+
### 利用 vLLM 部署 OpenAI API
|
| 785 |
+
|
| 786 |
+
```bash
|
| 787 |
+
API_PORT=8000 llamafactory-cli api examples/inference/llama3.yaml infer_backend=vllm vllm_enforce_eager=true
|
| 788 |
+
```
|
| 789 |
+
|
| 790 |
+
> [!TIP]
|
| 791 |
+
> API 文档请查阅[这里](https://platform.openai.com/docs/api-reference/chat/create)。
|
| 792 |
+
>
|
| 793 |
+
> 示例:[图像理解](scripts/api_example/test_image.py) | [工具调用](scripts/api_example/test_toolcall.py)
|
| 794 |
+
|
| 795 |
+
### 从魔搭社区下载
|
| 796 |
+
|
| 797 |
+
如果您在 Hugging Face 模型和数据集的下载中遇到了问题,可以通过下述方法使用魔搭社区。
|
| 798 |
+
|
| 799 |
+
```bash
|
| 800 |
+
export USE_MODELSCOPE_HUB=1 # Windows 使用 `set USE_MODELSCOPE_HUB=1`
|
| 801 |
+
```
|
| 802 |
+
|
| 803 |
+
将 `model_name_or_path` 设置为模型 ID 来加载对应的模型。在[魔搭社区](https://modelscope.cn/models)查看所有可用的模型,例如 `LLM-Research/Meta-Llama-3-8B-Instruct`。
|
| 804 |
+
|
| 805 |
+
### 从魔乐社区下载
|
| 806 |
+
|
| 807 |
+
您也可以通过下述方法,使用魔乐社区下载数据集和模型。
|
| 808 |
+
|
| 809 |
+
```bash
|
| 810 |
+
export USE_OPENMIND_HUB=1 # Windows 使用 `set USE_OPENMIND_HUB=1`
|
| 811 |
+
```
|
| 812 |
+
|
| 813 |
+
将 `model_name_or_path` 设置为模型 ID 来加载对应的模型。在[魔乐社区](https://modelers.cn/models)查看所有可用的模型,例如 `TeleAI/TeleChat-7B-pt`。
|
| 814 |
+
|
| 815 |
+
### 使用 W&B 面板
|
| 816 |
+
|
| 817 |
+
若要使用 [Weights & Biases](https://wandb.ai) 记录实验数据,请在 yaml 文件中添加下面的参数。
|
| 818 |
+
|
| 819 |
+
```yaml
|
| 820 |
+
report_to: wandb
|
| 821 |
+
run_name: test_run # 可选
|
| 822 |
+
```
|
| 823 |
+
|
| 824 |
+
在启动训练任务时,将 `WANDB_API_KEY` 设置为[密钥](https://wandb.ai/authorize)来登录 W&B 账户。
|
| 825 |
+
|
| 826 |
+
### 使用 SwanLab 面板
|
| 827 |
+
|
| 828 |
+
若要使用 [SwanLab](https://github.com/SwanHubX/SwanLab) 记录实验数据,请在 yaml 文件中添加下面的参数。
|
| 829 |
+
|
| 830 |
+
```yaml
|
| 831 |
+
use_swanlab: true
|
| 832 |
+
swanlab_run_name: test_run # 可选
|
| 833 |
+
```
|
| 834 |
+
|
| 835 |
+
在启动训练任务时,登录SwanLab账户有以下三种方式:
|
| 836 |
+
|
| 837 |
+
方式一:在 yaml 文件中添加 `swanlab_api_key=<your_api_key>` ,并设置为你的 [API 密钥](https://swanlab.cn/settings)。
|
| 838 |
+
方式二:将环境变量 `SWANLAB_API_KEY` 设置为你的 [API 密钥](https://swanlab.cn/settings)。
|
| 839 |
+
方式三:启动前使用 `swanlab login` 命令完成登录。
|
| 840 |
+
|
| 841 |
+
## 使用了 LLaMA Factory 的项目
|
| 842 |
+
|
| 843 |
+
如果您有项目希望添加至下述列表,请通过邮件联系或者创建一个 PR。
|
| 844 |
+
|
| 845 |
+
<details><summary>点击显示</summary>
|
| 846 |
+
|
| 847 |
+
1. Wang et al. ESRL: Efficient Sampling-based Reinforcement Learning for Sequence Generation. 2023. [[arxiv]](https://arxiv.org/abs/2308.02223)
|
| 848 |
+
1. Yu et al. Open, Closed, or Small Language Models for Text Classification? 2023. [[arxiv]](https://arxiv.org/abs/2308.10092)
|
| 849 |
+
1. Wang et al. UbiPhysio: Support Daily Functioning, Fitness, and Rehabilitation with Action Understanding and Feedback in Natural Language. 2023. [[arxiv]](https://arxiv.org/abs/2308.10526)
|
| 850 |
+
1. Luceri et al. Leveraging Large Language Models to Detect Influence Campaigns in Social Media. 2023. [[arxiv]](https://arxiv.org/abs/2311.07816)
|
| 851 |
+
1. Zhang et al. Alleviating Hallucinations of Large Language Models through Induced Hallucinations. 2023. [[arxiv]](https://arxiv.org/abs/2312.15710)
|
| 852 |
+
1. Wang et al. Know Your Needs Better: Towards Structured Understanding of Marketer Demands with Analogical Reasoning Augmented LLMs. KDD 2024. [[arxiv]](https://arxiv.org/abs/2401.04319)
|
| 853 |
+
1. Wang et al. CANDLE: Iterative Conceptualization and Instantiation Distillation from Large Language Models for Commonsense Reasoning. ACL 2024. [[arxiv]](https://arxiv.org/abs/2401.07286)
|
| 854 |
+
1. Choi et al. FACT-GPT: Fact-Checking Augmentation via Claim Matching with LLMs. 2024. [[arxiv]](https://arxiv.org/abs/2402.05904)
|
| 855 |
+
1. Zhang et al. AutoMathText: Autonomous Data Selection with Language Models for Mathematical Texts. 2024. [[arxiv]](https://arxiv.org/abs/2402.07625)
|
| 856 |
+
1. Lyu et al. KnowTuning: Knowledge-aware Fine-tuning for Large Language Models. 2024. [[arxiv]](https://arxiv.org/abs/2402.11176)
|
| 857 |
+
1. Yang et al. LaCo: Large Language Model Pruning via Layer Collaps. 2024. [[arxiv]](https://arxiv.org/abs/2402.11187)
|
| 858 |
+
1. Bhardwaj et al. Language Models are Homer Simpson! Safety Re-Alignment of Fine-tuned Language Models through Task Arithmetic. 2024. [[arxiv]](https://arxiv.org/abs/2402.11746)
|
| 859 |
+
1. Yang et al. Enhancing Empathetic Response Generation by Augmenting LLMs with Small-scale Empathetic Models. 2024. [[arxiv]](https://arxiv.org/abs/2402.11801)
|
| 860 |
+
1. Yi et al. Generation Meets Verification: Accelerating Large Language Model Inference with Smart Parallel Auto-Correct Decoding. ACL 2024 Findings. [[arxiv]](https://arxiv.org/abs/2402.11809)
|
| 861 |
+
1. Cao et al. Head-wise Shareable Attention for Large Language Models. 2024. [[arxiv]](https://arxiv.org/abs/2402.11819)
|
| 862 |
+
1. Zhang et al. Enhancing Multilingual Capabilities of Large Language Models through Self-Distillation from Resource-Rich Languages. 2024. [[arxiv]](https://arxiv.org/abs/2402.12204)
|
| 863 |
+
1. Kim et al. Efficient and Effective Vocabulary Expansion Towards Multilingual Large Language Models. 2024. [[arxiv]](https://arxiv.org/abs/2402.14714)
|
| 864 |
+
1. Yu et al. KIEval: A Knowledge-grounded Interactive Evaluation Framework for Large Language Models. ACL 2024. [[arxiv]](https://arxiv.org/abs/2402.15043)
|
| 865 |
+
1. Huang et al. Key-Point-Driven Data Synthesis with its Enhancement on Mathematical Reasoning. 2024. [[arxiv]](https://arxiv.org/abs/2403.02333)
|
| 866 |
+
1. Duan et al. Negating Negatives: Alignment without Human Positive Samples via Distributional Dispreference Optimization. 2024. [[arxiv]](https://arxiv.org/abs/2403.03419)
|
| 867 |
+
1. Xie and Schwertfeger. Empowering Robotics with Large Language Models: osmAG Map Comprehension with LLMs. 2024. [[arxiv]](https://arxiv.org/abs/2403.08228)
|
| 868 |
+
1. Wu et al. Large Language Models are Parallel Multilingual Learners. 2024. [[arxiv]](https://arxiv.org/abs/2403.09073)
|
| 869 |
+
1. Zhang et al. EDT: Improving Large Language Models' Generation by Entropy-based Dynamic Temperature Sampling. 2024. [[arxiv]](https://arxiv.org/abs/2403.14541)
|
| 870 |
+
1. Weller et al. FollowIR: Evaluating and Teaching Information Retrieval Models to Follow Instructions. 2024. [[arxiv]](https://arxiv.org/abs/2403.15246)
|
| 871 |
+
1. Hongbin Na. CBT-LLM: A Chinese Large Language Model for Cognitive Behavioral Therapy-based Mental Health Question Answering. COLING 2024. [[arxiv]](https://arxiv.org/abs/2403.16008)
|
| 872 |
+
1. Zan et al. CodeS: Natural Language to Code Repository via Multi-Layer Sketch. 2024. [[arxiv]](https://arxiv.org/abs/2403.16443)
|
| 873 |
+
1. Liu et al. Extensive Self-Contrast Enables Feedback-Free Language Model Alignment. 2024. [[arxiv]](https://arxiv.org/abs/2404.00604)
|
| 874 |
+
1. Luo et al. BAdam: A Memory Efficient Full Parameter Training Method for Large Language Models. 2024. [[arxiv]](https://arxiv.org/abs/2404.02827)
|
| 875 |
+
1. Du et al. Chinese Tiny LLM: Pretraining a Chinese-Centric Large Language Model. 2024. [[arxiv]](https://arxiv.org/abs/2404.04167)
|
| 876 |
+
1. Ma et al. Parameter Efficient Quasi-Orthogonal Fine-Tuning via Givens Rotation. ICML 2024. [[arxiv]](https://arxiv.org/abs/2404.04316)
|
| 877 |
+
1. Liu et al. Dynamic Generation of Personalities with Large Language Models. 2024. [[arxiv]](https://arxiv.org/abs/2404.07084)
|
| 878 |
+
1. Shang et al. How Far Have We Gone in Stripped Binary Code Understanding Using Large Language Models. 2024. [[arxiv]](https://arxiv.org/abs/2404.09836)
|
| 879 |
+
1. Huang et al. LLMTune: Accelerate Database Knob Tuning with Large Language Models. 2024. [[arxiv]](https://arxiv.org/abs/2404.11581)
|
| 880 |
+
1. Deng et al. Text-Tuple-Table: Towards Information Integration in Text-to-Table Generation via Global Tuple Extraction. 2024. [[arxiv]](https://arxiv.org/abs/2404.14215)
|
| 881 |
+
1. Acikgoz et al. Hippocrates: An Open-Source Framework for Advancing Large Language Models in Healthcare. 2024. [[arxiv]](https://arxiv.org/abs/2404.16621)
|
| 882 |
+
1. Zhang et al. Small Language Models Need Strong Verifiers to Self-Correct Reasoning. ACL 2024 Findings. [[arxiv]](https://arxiv.org/abs/2404.17140)
|
| 883 |
+
1. Zhou et al. FREB-TQA: A Fine-Grained Robustness Evaluation Benchmark for Table Question Answering. NAACL 2024. [[arxiv]](https://arxiv.org/abs/2404.18585)
|
| 884 |
+
1. Xu et al. Large Language Models for Cyber Security: A Systematic Literature Review. 2024. [[arxiv]](https://arxiv.org/abs/2405.04760)
|
| 885 |
+
1. Dammu et al. "They are uncultured": Unveiling Covert Harms and Social Threats in LLM Generated Conversations. 2024. [[arxiv]](https://arxiv.org/abs/2405.05378)
|
| 886 |
+
1. Yi et al. A safety realignment framework via subspace-oriented model fusion for large language models. 2024. [[arxiv]](https://arxiv.org/abs/2405.09055)
|
| 887 |
+
1. Lou et al. SPO: Multi-Dimensional Preference Sequential Alignment With Implicit Reward Modeling. 2024. [[arxiv]](https://arxiv.org/abs/2405.12739)
|
| 888 |
+
1. Zhang et al. Getting More from Less: Large Language Models are Good Spontaneous Multilingual Learners. 2024. [[arxiv]](https://arxiv.org/abs/2405.13816)
|
| 889 |
+
1. Zhang et al. TS-Align: A Teacher-Student Collaborative Framework for Scalable Iterative Finetuning of Large Language Models. 2024. [[arxiv]](https://arxiv.org/abs/2405.20215)
|
| 890 |
+
1. Zihong Chen. Sentence Segmentation and Sentence Punctuation Based on XunziALLM. 2024. [[paper]](https://aclanthology.org/2024.lt4hala-1.30)
|
| 891 |
+
1. Gao et al. The Best of Both Worlds: Toward an Honest and Helpful Large Language Model. 2024. [[arxiv]](https://arxiv.org/abs/2406.00380)
|
| 892 |
+
1. Wang and Song. MARS: Benchmarking the Metaphysical Reasoning Abilities of Language Models with a Multi-task Evaluation Dataset. 2024. [[arxiv]](https://arxiv.org/abs/2406.02106)
|
| 893 |
+
1. Hu et al. Computational Limits of Low-Rank Adaptation (LoRA) for Transformer-Based Models. 2024. [[arxiv]](https://arxiv.org/abs/2406.03136)
|
| 894 |
+
1. Ge et al. Time Sensitive Knowledge Editing through Efficient Finetuning. ACL 2024. [[arxiv]](https://arxiv.org/abs/2406.04496)
|
| 895 |
+
1. Tan et al. Peer Review as A Multi-Turn and Long-Context Dialogue with Role-Based Interactions. 2024. [[arxiv]](https://arxiv.org/abs/2406.05688)
|
| 896 |
+
1. Song et al. Turbo Sparse: Achieving LLM SOTA Performance with Minimal Activated Parameters. 2024. [[arxiv]](https://arxiv.org/abs/2406.05955)
|
| 897 |
+
1. Gu et al. RWKV-CLIP: A Robust Vision-Language Representation Learner. 2024. [[arxiv]](https://arxiv.org/abs/2406.06973)
|
| 898 |
+
1. Chen et al. Advancing Tool-Augmented Large Language Models: Integrating Insights from Errors in Inference Trees. 2024. [[arxiv]](https://arxiv.org/abs/2406.07115)
|
| 899 |
+
1. Zhu et al. Are Large Language Models Good Statisticians?. 2024. [[arxiv]](https://arxiv.org/abs/2406.07815)
|
| 900 |
+
1. Li et al. Know the Unknown: An Uncertainty-Sensitive Method for LLM Instruction Tuning. 2024. [[arxiv]](https://arxiv.org/abs/2406.10099)
|
| 901 |
+
1. Ding et al. IntentionQA: A Benchmark for Evaluating Purchase Intention Comprehension Abilities of Language Models in E-commerce. 2024. [[arxiv]](https://arxiv.org/abs/2406.10173)
|
| 902 |
+
1. He et al. COMMUNITY-CROSS-INSTRUCT: Unsupervised Instruction Generation for Aligning Large Language Models to Online Communities. 2024. [[arxiv]](https://arxiv.org/abs/2406.12074)
|
| 903 |
+
1. Lin et al. FVEL: Interactive Formal Verification Environment with Large Language Models via Theorem Proving. 2024. [[arxiv]](https://arxiv.org/abs/2406.14408)
|
| 904 |
+
1. Treutlein et al. Connecting the Dots: LLMs can Infer and Verbalize Latent Structure from Disparate Training Data. 2024. [[arxiv]](https://arxiv.org/abs/2406.14546)
|
| 905 |
+
1. Feng et al. SS-Bench: A Benchmark for Social Story Generation and Evaluation. 2024. [[arxiv]](https://arxiv.org/abs/2406.15695)
|
| 906 |
+
1. Feng et al. Self-Constructed Context Decompilation with Fined-grained Alignment Enhancement. 2024. [[arxiv]](https://arxiv.org/abs/2406.17233)
|
| 907 |
+
1. Liu et al. Large Language Models for Cuffless Blood Pressure Measurement From Wearable Biosignals. 2024. [[arxiv]](https://arxiv.org/abs/2406.18069)
|
| 908 |
+
1. Iyer et al. Exploring Very Low-Resource Translation with LLMs: The University of Edinburgh's Submission to AmericasNLP 2024 Translation Task. AmericasNLP 2024. [[paper]](https://aclanthology.org/2024.americasnlp-1.25)
|
| 909 |
+
1. Li et al. Calibrating LLMs with Preference Optimization on Thought Trees for Generating Rationale in Science Question Scoring. 2024. [[arxiv]](https://arxiv.org/abs/2406.19949)
|
| 910 |
+
1. Yang et al. Financial Knowledge Large Language Model. 2024. [[arxiv]](https://arxiv.org/abs/2407.00365)
|
| 911 |
+
1. Lin et al. DogeRM: Equipping Reward Models with Domain Knowledge through Model Merging. 2024. [[arxiv]](https://arxiv.org/abs/2407.01470)
|
| 912 |
+
1. Bako et al. Evaluating the Semantic Profiling Abilities of LLMs for Natural Language Utterances in Data Visualization. 2024. [[arxiv]](https://arxiv.org/abs/2407.06129)
|
| 913 |
+
1. Huang et al. RoLoRA: Fine-tuning Rotated Outlier-free LLMs for Effective Weight-Activation Quantization. 2024. [[arxiv]](https://arxiv.org/abs/2407.08044)
|
| 914 |
+
1. Jiang et al. LLM-Collaboration on Automatic Science Journalism for the General Audience. 2024. [[arxiv]](https://arxiv.org/abs/2407.09756)
|
| 915 |
+
1. Inouye et al. Applied Auto-tuning on LoRA Hyperparameters. 2024. [[paper]](https://scholarcommons.scu.edu/cseng_senior/272/)
|
| 916 |
+
1. Qi et al. Research on Tibetan Tourism Viewpoints information generation system based on LLM. 2024. [[arxiv]](https://arxiv.org/abs/2407.13561)
|
| 917 |
+
1. Xu et al. Course-Correction: Safety Alignment Using Synthetic Preferences. 2024. [[arxiv]](https://arxiv.org/abs/2407.16637)
|
| 918 |
+
1. Sun et al. LAMBDA: A Large Model Based Data Agent. 2024. [[arxiv]](https://arxiv.org/abs/2407.17535)
|
| 919 |
+
1. Zhu et al. CollectiveSFT: Scaling Large Language Models for Chinese Medical Benchmark with Collective Instructions in Healthcare. 2024. [[arxiv]](https://arxiv.org/abs/2407.19705)
|
| 920 |
+
1. Yu et al. Correcting Negative Bias in Large Language Models through Negative Attention Score Alignment. 2024. [[arxiv]](https://arxiv.org/abs/2408.00137)
|
| 921 |
+
1. Xie et al. The Power of Personalized Datasets: Advancing Chinese Composition Writing for Elementary School through Targeted Model Fine-Tuning. IALP 2024. [[paper]](https://www.asianlp.sg/conferences/ialp2024/proceedings/papers/IALP2024_P055.pdf)
|
| 922 |
+
1. Liu et al. Instruct-Code-Llama: Improving Capabilities of Language Model in Competition Level Code Generation by Online Judge Feedback. ICIC 2024. [[paper]](https://link.springer.com/chapter/10.1007/978-981-97-5669-8_11)
|
| 923 |
+
1. Wang et al. Cybernetic Sentinels: Unveiling the Impact of Safety Data Selection on Model Security in Supervised Fine-Tuning. ICIC 2024. [[paper]](https://link.springer.com/chapter/10.1007/978-981-97-5669-8_23)
|
| 924 |
+
1. Xia et al. Understanding the Performance and Estimating the Cost of LLM Fine-Tuning. 2024. [[arxiv]](https://arxiv.org/abs/2408.04693)
|
| 925 |
+
1. Zeng et al. Perceive, Reflect, and Plan: Designing LLM Agent for Goal-Directed City Navigation without Instructions. 2024. [[arxiv]](https://arxiv.org/abs/2408.04168)
|
| 926 |
+
1. Xia et al. Using Pre-trained Language Model for Accurate ESG Prediction. FinNLP 2024. [[paper]](https://aclanthology.org/2024.finnlp-2.1/)
|
| 927 |
+
1. Liang et al. I-SHEEP: Self-Alignment of LLM from Scratch through an Iterative Self-Enhancement Paradigm. 2024. [[arxiv]](https://arxiv.org/abs/2408.08072)
|
| 928 |
+
1. Bai et al. Aligning Large Language Model with Direct Multi-Preference Optimization for Recommendation. CIKM 2024. [[paper]](https://dl.acm.org/doi/10.1145/3627673.3679611)
|
| 929 |
+
1. **[StarWhisper](https://github.com/Yu-Yang-Li/StarWhisper)**: 天文大模型 StarWhisper,基于 ChatGLM2-6B 和 Qwen-14B 在天文数据上微调而得。
|
| 930 |
+
1. **[DISC-LawLLM](https://github.com/FudanDISC/DISC-LawLLM)**: 中文法律领域大模型 DISC-LawLLM,基于 Baichuan-13B 微调而得,具有法律推理和知识检索能力。
|
| 931 |
+
1. **[Sunsimiao](https://github.com/X-D-Lab/Sunsimiao)**: 孙思邈中文医疗大模型 Sumsimiao,基于 Baichuan-7B 和 ChatGLM-6B 在中文医疗数据上微调而得。
|
| 932 |
+
1. **[CareGPT](https://github.com/WangRongsheng/CareGPT)**: 医疗大模型项目 CareGPT,基于 LLaMA2-7B 和 Baichuan-13B 在中文医疗数据上微调而得。
|
| 933 |
+
1. **[MachineMindset](https://github.com/PKU-YuanGroup/Machine-Mindset/)**:MBTI性格大模型项目,根据数据集与训练方式让任意 LLM 拥有 16 个不同的性格类型。
|
| 934 |
+
1. **[Luminia-13B-v3](https://huggingface.co/Nekochu/Luminia-13B-v3)**:一个用于生成 Stable Diffusion 提示词的大型语言模型。[[demo]](https://huggingface.co/spaces/Nekochu/Luminia-13B_SD_Prompt)
|
| 935 |
+
1. **[Chinese-LLaVA-Med](https://github.com/BUAADreamer/Chinese-LLaVA-Med)**:中文多模态医学大模型,基于 LLaVA-1.5-7B 在中文多模态医疗数据上微调而得。
|
| 936 |
+
1. **[AutoRE](https://github.com/THUDM/AutoRE)**:基于大语言模型的文档级关系抽取系统。
|
| 937 |
+
1. **[NVIDIA RTX AI Toolkit](https://github.com/NVIDIA/RTX-AI-Toolkit)**:在 Windows 主机上利用英伟达 RTX 设备进行大型语言模型微调的开发包。
|
| 938 |
+
1. **[LazyLLM](https://github.com/LazyAGI/LazyLLM)**:一个低代码构建多 Agent 大模型应用的开发工具,支持基于 LLaMA Factory 的模型微调.
|
| 939 |
+
1. **[RAG-Retrieval](https://github.com/NLPJCL/RAG-Retrieval)**:一个全链路 RAG 检索模型微调、推理和蒸馏代码库。[[blog]](https://zhuanlan.zhihu.com/p/987727357)
|
| 940 |
+
1. **[360-LLaMA-Factory](https://github.com/Qihoo360/360-LLaMA-Factory)**:一个魔改后的代码库,通过 Ring Attention 支持长序列的 SFT 和 DPO 训练。
|
| 941 |
+
1. **[Sky-T1](https://novasky-ai.github.io/posts/sky-t1/)**:由 NovaSky AI 微调的低成本类 o1 长推理模型。
|
| 942 |
+
1. **[WeClone](https://github.com/xming521/WeClone)**:从聊天记录创造数字分身的一站式解决方案。
|
| 943 |
+
|
| 944 |
+
</details>
|
| 945 |
+
|
| 946 |
+
## 协议
|
| 947 |
+
|
| 948 |
+
本仓库的代码依照 [Apache-2.0](LICENSE) 协议开源。
|
| 949 |
+
|
| 950 |
+
使用模型权重时,请遵循对应的模型协议:[Baichuan 2](https://huggingface.co/baichuan-inc/Baichuan2-7B-Base/blob/main/Community%20License%20for%20Baichuan%202%20Model.pdf) / [BLOOM](https://huggingface.co/spaces/bigscience/license) / [ChatGLM3](https://github.com/THUDM/ChatGLM3/blob/main/MODEL_LICENSE) / [Command R](https://cohere.com/c4ai-cc-by-nc-license) / [DeepSeek](https://github.com/deepseek-ai/DeepSeek-LLM/blob/main/LICENSE-MODEL) / [Falcon](https://huggingface.co/tiiuae/falcon-180B/blob/main/LICENSE.txt) / [Gemma](https://ai.google.dev/gemma/terms) / [GLM-4](https://huggingface.co/THUDM/glm-4-9b/blob/main/LICENSE) / [GPT-2](https://github.com/openai/gpt-2/blob/master/LICENSE) / [Granite](LICENSE) / [Index](https://huggingface.co/IndexTeam/Index-1.9B/blob/main/LICENSE) / [InternLM](https://github.com/InternLM/InternLM#license) / [Llama](https://github.com/facebookresearch/llama/blob/main/MODEL_CARD.md) / [Llama 2](https://ai.meta.com/llama/license/) / [Llama 3](https://llama.meta.com/llama3/license/) / [Llama 4](https://github.com/meta-llama/llama-models/blob/main/models/llama4/LICENSE) / [MiniCPM](https://github.com/OpenBMB/MiniCPM/blob/main/MiniCPM%20Model%20License.md) / [Mistral/Mixtral/Pixtral](LICENSE) / [OLMo](LICENSE) / [Phi-1.5/Phi-2](https://huggingface.co/microsoft/phi-1_5/resolve/main/Research%20License.docx) / [Phi-3/Phi-4](https://huggingface.co/microsoft/Phi-3-mini-4k-instruct/blob/main/LICENSE) / [Qwen](https://github.com/QwenLM/Qwen/blob/main/Tongyi%20Qianwen%20LICENSE%20AGREEMENT) / [Skywork](https://huggingface.co/Skywork/Skywork-13B-base/blob/main/Skywork%20Community%20License.pdf) / [StarCoder 2](https://huggingface.co/spaces/bigcode/bigcode-model-license-agreement) / [TeleChat2](https://huggingface.co/Tele-AI/telechat-7B/blob/main/TeleChat%E6%A8%A1%E5%9E%8B%E7%A4%BE%E5%8C%BA%E8%AE%B8%E5%8F%AF%E5%8D%8F%E8%AE%AE.pdf) / [XVERSE](https://github.com/xverse-ai/XVERSE-13B/blob/main/MODEL_LICENSE.pdf) / [Yi](https://huggingface.co/01-ai/Yi-6B/blob/main/LICENSE) / [Yi-1.5](LICENSE) / [Yuan 2](https://github.com/IEIT-Yuan/Yuan-2.0/blob/main/LICENSE-Yuan)
|
| 951 |
+
|
| 952 |
+
## 引用
|
| 953 |
+
|
| 954 |
+
如果您觉得此项目有帮助,请考虑以下列格式引用
|
| 955 |
+
|
| 956 |
+
```bibtex
|
| 957 |
+
@inproceedings{zheng2024llamafactory,
|
| 958 |
+
title={LlamaFactory: Unified Efficient Fine-Tuning of 100+ Language Models},
|
| 959 |
+
author={Yaowei Zheng and Richong Zhang and Junhao Zhang and Yanhan Ye and Zheyan Luo and Zhangchi Feng and Yongqiang Ma},
|
| 960 |
+
booktitle={Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 3: System Demonstrations)},
|
| 961 |
+
address={Bangkok, Thailand},
|
| 962 |
+
publisher={Association for Computational Linguistics},
|
| 963 |
+
year={2024},
|
| 964 |
+
url={http://arxiv.org/abs/2403.13372}
|
| 965 |
+
}
|
| 966 |
+
```
|
| 967 |
+
|
| 968 |
+
## 致谢
|
| 969 |
+
|
| 970 |
+
本项目受益于 [PEFT](https://github.com/huggingface/peft)、[TRL](https://github.com/huggingface/trl)、[QLoRA](https://github.com/artidoro/qlora) 和 [FastChat](https://github.com/lm-sys/FastChat),感谢以上诸位作者的付出。
|
| 971 |
+
|
| 972 |
+
## Star History
|
| 973 |
+
|
| 974 |
+

|
data/README.md
ADDED
|
@@ -0,0 +1,475 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
The [dataset_info.json](dataset_info.json) contains all available datasets. If you are using a custom dataset, please **make sure** to add a *dataset description* in `dataset_info.json` and specify `dataset: dataset_name` before training to use it.
|
| 2 |
+
|
| 3 |
+
The `dataset_info.json` file should be put in the `dataset_dir` directory. You can change `dataset_dir` to use another directory. The default value is `./data`.
|
| 4 |
+
|
| 5 |
+
Currently we support datasets in **alpaca** and **sharegpt** format. Allowed file types include json, jsonl, csv, parquet, arrow.
|
| 6 |
+
|
| 7 |
+
```json
|
| 8 |
+
"dataset_name": {
|
| 9 |
+
"hf_hub_url": "the name of the dataset repository on the Hugging Face hub. (if specified, ignore script_url, file_name and cloud_file_name)",
|
| 10 |
+
"ms_hub_url": "the name of the dataset repository on the Model Scope hub. (if specified, ignore script_url, file_name and cloud_file_name)",
|
| 11 |
+
"script_url": "the name of the directory containing a dataset loading script. (if specified, ignore file_name and cloud_file_name)",
|
| 12 |
+
"cloud_file_name": "the name of the dataset file in s3/gcs cloud storage. (if specified, ignore file_name)",
|
| 13 |
+
"file_name": "the name of the dataset folder or dataset file in this directory. (required if above are not specified)",
|
| 14 |
+
"formatting": "the format of the dataset. (optional, default: alpaca, can be chosen from {alpaca, sharegpt})",
|
| 15 |
+
"ranking": "whether the dataset is a preference dataset or not. (default: False)",
|
| 16 |
+
"subset": "the name of the subset. (optional, default: None)",
|
| 17 |
+
"split": "the name of dataset split to be used. (optional, default: train)",
|
| 18 |
+
"folder": "the name of the folder of the dataset repository on the Hugging Face hub. (optional, default: None)",
|
| 19 |
+
"num_samples": "the number of samples in the dataset to be used. (optional, default: None)",
|
| 20 |
+
"columns (optional)": {
|
| 21 |
+
"prompt": "the column name in the dataset containing the prompts. (default: instruction)",
|
| 22 |
+
"query": "the column name in the dataset containing the queries. (default: input)",
|
| 23 |
+
"response": "the column name in the dataset containing the responses. (default: output)",
|
| 24 |
+
"history": "the column name in the dataset containing the histories. (default: None)",
|
| 25 |
+
"messages": "the column name in the dataset containing the messages. (default: conversations)",
|
| 26 |
+
"system": "the column name in the dataset containing the system prompts. (default: None)",
|
| 27 |
+
"tools": "the column name in the dataset containing the tool description. (default: None)",
|
| 28 |
+
"images": "the column name in the dataset containing the image inputs. (default: None)",
|
| 29 |
+
"videos": "the column name in the dataset containing the videos inputs. (default: None)",
|
| 30 |
+
"audios": "the column name in the dataset containing the audios inputs. (default: None)",
|
| 31 |
+
"chosen": "the column name in the dataset containing the chosen answers. (default: None)",
|
| 32 |
+
"rejected": "the column name in the dataset containing the rejected answers. (default: None)",
|
| 33 |
+
"kto_tag": "the column name in the dataset containing the kto tags. (default: None)"
|
| 34 |
+
},
|
| 35 |
+
"tags (optional, used for the sharegpt format)": {
|
| 36 |
+
"role_tag": "the key in the message represents the identity. (default: from)",
|
| 37 |
+
"content_tag": "the key in the message represents the content. (default: value)",
|
| 38 |
+
"user_tag": "the value of the role_tag represents the user. (default: human)",
|
| 39 |
+
"assistant_tag": "the value of the role_tag represents the assistant. (default: gpt)",
|
| 40 |
+
"observation_tag": "the value of the role_tag represents the tool results. (default: observation)",
|
| 41 |
+
"function_tag": "the value of the role_tag represents the function call. (default: function_call)",
|
| 42 |
+
"system_tag": "the value of the role_tag represents the system prompt. (default: system, can override system column)"
|
| 43 |
+
}
|
| 44 |
+
}
|
| 45 |
+
```
|
| 46 |
+
|
| 47 |
+
## Alpaca Format
|
| 48 |
+
|
| 49 |
+
### Supervised Fine-Tuning Dataset
|
| 50 |
+
|
| 51 |
+
* [Example dataset](alpaca_en_demo.json)
|
| 52 |
+
|
| 53 |
+
In supervised fine-tuning, the `instruction` column will be concatenated with the `input` column and used as the user prompt, then the user prompt would be `instruction\ninput`. The `output` column represents the model response.
|
| 54 |
+
|
| 55 |
+
For reasoning models, if the dataset contains chain-of-thought (CoT), the CoT needs to be placed in the model responses, such as `<think>cot</think>output`.
|
| 56 |
+
|
| 57 |
+
The `system` column will be used as the system prompt if specified.
|
| 58 |
+
|
| 59 |
+
The `history` column is a list consisting of string tuples representing prompt-response pairs in the history messages. Note that the responses in the history **will also be learned by the model** in supervised fine-tuning.
|
| 60 |
+
|
| 61 |
+
```json
|
| 62 |
+
[
|
| 63 |
+
{
|
| 64 |
+
"instruction": "user instruction (required)",
|
| 65 |
+
"input": "user input (optional)",
|
| 66 |
+
"output": "model response (required)",
|
| 67 |
+
"system": "system prompt (optional)",
|
| 68 |
+
"history": [
|
| 69 |
+
["user instruction in the first round (optional)", "model response in the first round (optional)"],
|
| 70 |
+
["user instruction in the second round (optional)", "model response in the second round (optional)"]
|
| 71 |
+
]
|
| 72 |
+
}
|
| 73 |
+
]
|
| 74 |
+
```
|
| 75 |
+
|
| 76 |
+
Regarding the above dataset, the *dataset description* in `dataset_info.json` should be:
|
| 77 |
+
|
| 78 |
+
```json
|
| 79 |
+
"dataset_name": {
|
| 80 |
+
"file_name": "data.json",
|
| 81 |
+
"columns": {
|
| 82 |
+
"prompt": "instruction",
|
| 83 |
+
"query": "input",
|
| 84 |
+
"response": "output",
|
| 85 |
+
"system": "system",
|
| 86 |
+
"history": "history"
|
| 87 |
+
}
|
| 88 |
+
}
|
| 89 |
+
```
|
| 90 |
+
|
| 91 |
+
> [!TIP]
|
| 92 |
+
> If the model has reasoning capabilities (e.g. Qwen3) but the dataset does not contain chain-of-thought (CoT), LLaMA-Factory will automatically add empty CoT to the data. When `enable_thinking` is `True` (slow thinking, by default), the empty CoT will be added to the model responses and loss computation will be considered; otherwise (fast thinking), it will be added to the user prompts and loss computation will be ignored. Please keep the `enable_thinking` parameter consistent during training and inference.
|
| 93 |
+
>
|
| 94 |
+
> If you want to train data containing CoT with slow thinking and data without CoT with fast thinking, you can set `enable_thinking` to `None`. However, this feature is relatively complicated and should be used with caution.
|
| 95 |
+
|
| 96 |
+
### Pre-training Dataset
|
| 97 |
+
|
| 98 |
+
- [Example dataset](c4_demo.jsonl)
|
| 99 |
+
|
| 100 |
+
In pre-training, only the `text` column will be used for model learning.
|
| 101 |
+
|
| 102 |
+
```json
|
| 103 |
+
[
|
| 104 |
+
{"text": "document"},
|
| 105 |
+
{"text": "document"}
|
| 106 |
+
]
|
| 107 |
+
```
|
| 108 |
+
|
| 109 |
+
Regarding the above dataset, the *dataset description* in `dataset_info.json` should be:
|
| 110 |
+
|
| 111 |
+
```json
|
| 112 |
+
"dataset_name": {
|
| 113 |
+
"file_name": "data.json",
|
| 114 |
+
"columns": {
|
| 115 |
+
"prompt": "text"
|
| 116 |
+
}
|
| 117 |
+
}
|
| 118 |
+
```
|
| 119 |
+
|
| 120 |
+
### Preference Dataset
|
| 121 |
+
|
| 122 |
+
Preference datasets are used for reward modeling, DPO training, ORPO and SimPO training.
|
| 123 |
+
|
| 124 |
+
It requires a better response in `chosen` column and a worse response in `rejected` column.
|
| 125 |
+
|
| 126 |
+
```json
|
| 127 |
+
[
|
| 128 |
+
{
|
| 129 |
+
"instruction": "user instruction (required)",
|
| 130 |
+
"input": "user input (optional)",
|
| 131 |
+
"chosen": "chosen answer (required)",
|
| 132 |
+
"rejected": "rejected answer (required)"
|
| 133 |
+
}
|
| 134 |
+
]
|
| 135 |
+
```
|
| 136 |
+
|
| 137 |
+
Regarding the above dataset, the *dataset description* in `dataset_info.json` should be:
|
| 138 |
+
|
| 139 |
+
```json
|
| 140 |
+
"dataset_name": {
|
| 141 |
+
"file_name": "data.json",
|
| 142 |
+
"ranking": true,
|
| 143 |
+
"columns": {
|
| 144 |
+
"prompt": "instruction",
|
| 145 |
+
"query": "input",
|
| 146 |
+
"chosen": "chosen",
|
| 147 |
+
"rejected": "rejected"
|
| 148 |
+
}
|
| 149 |
+
}
|
| 150 |
+
```
|
| 151 |
+
|
| 152 |
+
### KTO Dataset
|
| 153 |
+
|
| 154 |
+
An additional column `kto_tag` is required. Please refer to the [sharegpt](#sharegpt-format) format for details.
|
| 155 |
+
|
| 156 |
+
### Multimodal Image Dataset
|
| 157 |
+
|
| 158 |
+
An additional column `images` is required. Please refer to the [sharegpt](#sharegpt-format) format for details.
|
| 159 |
+
|
| 160 |
+
### Multimodal Video Dataset
|
| 161 |
+
|
| 162 |
+
An additional column `videos` is required. Please refer to the [sharegpt](#sharegpt-format) format for details.
|
| 163 |
+
|
| 164 |
+
### Multimodal Audio Dataset
|
| 165 |
+
|
| 166 |
+
An additional column `audios` is required. Please refer to the [sharegpt](#sharegpt-format) format for details.
|
| 167 |
+
|
| 168 |
+
## Sharegpt Format
|
| 169 |
+
|
| 170 |
+
### Supervised Fine-Tuning Dataset
|
| 171 |
+
|
| 172 |
+
- [Example dataset](glaive_toolcall_en_demo.json)
|
| 173 |
+
|
| 174 |
+
Compared to the alpaca format, the sharegpt format allows the datasets have **more roles**, such as human, gpt, observation and function. They are presented in a list of objects in the `conversations` column.
|
| 175 |
+
|
| 176 |
+
Note that the human and observation should appear in odd positions, while gpt and function should appear in even positions. The gpt and function will be learned by the model.
|
| 177 |
+
|
| 178 |
+
```json
|
| 179 |
+
[
|
| 180 |
+
{
|
| 181 |
+
"conversations": [
|
| 182 |
+
{
|
| 183 |
+
"from": "human",
|
| 184 |
+
"value": "user instruction"
|
| 185 |
+
},
|
| 186 |
+
{
|
| 187 |
+
"from": "function_call",
|
| 188 |
+
"value": "tool arguments"
|
| 189 |
+
},
|
| 190 |
+
{
|
| 191 |
+
"from": "observation",
|
| 192 |
+
"value": "tool result"
|
| 193 |
+
},
|
| 194 |
+
{
|
| 195 |
+
"from": "gpt",
|
| 196 |
+
"value": "model response"
|
| 197 |
+
}
|
| 198 |
+
],
|
| 199 |
+
"system": "system prompt (optional)",
|
| 200 |
+
"tools": "tool description (optional)"
|
| 201 |
+
}
|
| 202 |
+
]
|
| 203 |
+
```
|
| 204 |
+
|
| 205 |
+
Regarding the above dataset, the *dataset description* in `dataset_info.json` should be:
|
| 206 |
+
|
| 207 |
+
```json
|
| 208 |
+
"dataset_name": {
|
| 209 |
+
"file_name": "data.json",
|
| 210 |
+
"formatting": "sharegpt",
|
| 211 |
+
"columns": {
|
| 212 |
+
"messages": "conversations",
|
| 213 |
+
"system": "system",
|
| 214 |
+
"tools": "tools"
|
| 215 |
+
}
|
| 216 |
+
}
|
| 217 |
+
```
|
| 218 |
+
|
| 219 |
+
### Pre-training Dataset
|
| 220 |
+
|
| 221 |
+
Not yet supported, please use the [alpaca](#alpaca-format) format.
|
| 222 |
+
|
| 223 |
+
### Preference Dataset
|
| 224 |
+
|
| 225 |
+
- [Example dataset](dpo_en_demo.json)
|
| 226 |
+
|
| 227 |
+
Preference datasets in sharegpt format also require a better message in `chosen` column and a worse message in `rejected` column.
|
| 228 |
+
|
| 229 |
+
```json
|
| 230 |
+
[
|
| 231 |
+
{
|
| 232 |
+
"conversations": [
|
| 233 |
+
{
|
| 234 |
+
"from": "human",
|
| 235 |
+
"value": "user instruction"
|
| 236 |
+
},
|
| 237 |
+
{
|
| 238 |
+
"from": "gpt",
|
| 239 |
+
"value": "model response"
|
| 240 |
+
},
|
| 241 |
+
{
|
| 242 |
+
"from": "human",
|
| 243 |
+
"value": "user instruction"
|
| 244 |
+
}
|
| 245 |
+
],
|
| 246 |
+
"chosen": {
|
| 247 |
+
"from": "gpt",
|
| 248 |
+
"value": "chosen answer (required)"
|
| 249 |
+
},
|
| 250 |
+
"rejected": {
|
| 251 |
+
"from": "gpt",
|
| 252 |
+
"value": "rejected answer (required)"
|
| 253 |
+
}
|
| 254 |
+
}
|
| 255 |
+
]
|
| 256 |
+
```
|
| 257 |
+
|
| 258 |
+
Regarding the above dataset, the *dataset description* in `dataset_info.json` should be:
|
| 259 |
+
|
| 260 |
+
```json
|
| 261 |
+
"dataset_name": {
|
| 262 |
+
"file_name": "data.json",
|
| 263 |
+
"formatting": "sharegpt",
|
| 264 |
+
"ranking": true,
|
| 265 |
+
"columns": {
|
| 266 |
+
"messages": "conversations",
|
| 267 |
+
"chosen": "chosen",
|
| 268 |
+
"rejected": "rejected"
|
| 269 |
+
}
|
| 270 |
+
}
|
| 271 |
+
```
|
| 272 |
+
|
| 273 |
+
### KTO Dataset
|
| 274 |
+
|
| 275 |
+
- [Example dataset](kto_en_demo.json)
|
| 276 |
+
|
| 277 |
+
KTO datasets require a extra `kto_tag` column containing the boolean human feedback.
|
| 278 |
+
|
| 279 |
+
```json
|
| 280 |
+
[
|
| 281 |
+
{
|
| 282 |
+
"conversations": [
|
| 283 |
+
{
|
| 284 |
+
"from": "human",
|
| 285 |
+
"value": "user instruction"
|
| 286 |
+
},
|
| 287 |
+
{
|
| 288 |
+
"from": "gpt",
|
| 289 |
+
"value": "model response"
|
| 290 |
+
}
|
| 291 |
+
],
|
| 292 |
+
"kto_tag": "human feedback [true/false] (required)"
|
| 293 |
+
}
|
| 294 |
+
]
|
| 295 |
+
```
|
| 296 |
+
|
| 297 |
+
Regarding the above dataset, the *dataset description* in `dataset_info.json` should be:
|
| 298 |
+
|
| 299 |
+
```json
|
| 300 |
+
"dataset_name": {
|
| 301 |
+
"file_name": "data.json",
|
| 302 |
+
"formatting": "sharegpt",
|
| 303 |
+
"columns": {
|
| 304 |
+
"messages": "conversations",
|
| 305 |
+
"kto_tag": "kto_tag"
|
| 306 |
+
}
|
| 307 |
+
}
|
| 308 |
+
```
|
| 309 |
+
|
| 310 |
+
### Multimodal Image Dataset
|
| 311 |
+
|
| 312 |
+
- [Example dataset](mllm_demo.json)
|
| 313 |
+
|
| 314 |
+
Multimodal image datasets require an `images` column containing the paths to the input images.
|
| 315 |
+
|
| 316 |
+
The number of images should be identical to the `<image>` tokens in the conversations.
|
| 317 |
+
|
| 318 |
+
```json
|
| 319 |
+
[
|
| 320 |
+
{
|
| 321 |
+
"conversations": [
|
| 322 |
+
{
|
| 323 |
+
"from": "human",
|
| 324 |
+
"value": "<image>user instruction"
|
| 325 |
+
},
|
| 326 |
+
{
|
| 327 |
+
"from": "gpt",
|
| 328 |
+
"value": "model response"
|
| 329 |
+
}
|
| 330 |
+
],
|
| 331 |
+
"images": [
|
| 332 |
+
"image path (required)"
|
| 333 |
+
]
|
| 334 |
+
}
|
| 335 |
+
]
|
| 336 |
+
```
|
| 337 |
+
|
| 338 |
+
Regarding the above dataset, the *dataset description* in `dataset_info.json` should be:
|
| 339 |
+
|
| 340 |
+
```json
|
| 341 |
+
"dataset_name": {
|
| 342 |
+
"file_name": "data.json",
|
| 343 |
+
"formatting": "sharegpt",
|
| 344 |
+
"columns": {
|
| 345 |
+
"messages": "conversations",
|
| 346 |
+
"images": "images"
|
| 347 |
+
}
|
| 348 |
+
}
|
| 349 |
+
```
|
| 350 |
+
|
| 351 |
+
### Multimodal Video Dataset
|
| 352 |
+
|
| 353 |
+
- [Example dataset](mllm_video_demo.json)
|
| 354 |
+
|
| 355 |
+
Multimodal video datasets require a `videos` column containing the paths to the input videos.
|
| 356 |
+
|
| 357 |
+
The number of videos should be identical to the `<video>` tokens in the conversations.
|
| 358 |
+
|
| 359 |
+
```json
|
| 360 |
+
[
|
| 361 |
+
{
|
| 362 |
+
"conversations": [
|
| 363 |
+
{
|
| 364 |
+
"from": "human",
|
| 365 |
+
"value": "<video>user instruction"
|
| 366 |
+
},
|
| 367 |
+
{
|
| 368 |
+
"from": "gpt",
|
| 369 |
+
"value": "model response"
|
| 370 |
+
}
|
| 371 |
+
],
|
| 372 |
+
"videos": [
|
| 373 |
+
"video path (required)"
|
| 374 |
+
]
|
| 375 |
+
}
|
| 376 |
+
]
|
| 377 |
+
```
|
| 378 |
+
|
| 379 |
+
Regarding the above dataset, the *dataset description* in `dataset_info.json` should be:
|
| 380 |
+
|
| 381 |
+
```json
|
| 382 |
+
"dataset_name": {
|
| 383 |
+
"file_name": "data.json",
|
| 384 |
+
"formatting": "sharegpt",
|
| 385 |
+
"columns": {
|
| 386 |
+
"messages": "conversations",
|
| 387 |
+
"videos": "videos"
|
| 388 |
+
}
|
| 389 |
+
}
|
| 390 |
+
```
|
| 391 |
+
|
| 392 |
+
### Multimodal Audio Dataset
|
| 393 |
+
|
| 394 |
+
- [Example dataset](mllm_audio_demo.json)
|
| 395 |
+
|
| 396 |
+
Multimodal audio datasets require an `audios` column containing the paths to the input audios.
|
| 397 |
+
|
| 398 |
+
The number of audios should be identical to the `<audio>` tokens in the conversations.
|
| 399 |
+
|
| 400 |
+
```json
|
| 401 |
+
[
|
| 402 |
+
{
|
| 403 |
+
"conversations": [
|
| 404 |
+
{
|
| 405 |
+
"from": "human",
|
| 406 |
+
"value": "<audio>user instruction"
|
| 407 |
+
},
|
| 408 |
+
{
|
| 409 |
+
"from": "gpt",
|
| 410 |
+
"value": "model response"
|
| 411 |
+
}
|
| 412 |
+
],
|
| 413 |
+
"audios": [
|
| 414 |
+
"audio path (required)"
|
| 415 |
+
]
|
| 416 |
+
}
|
| 417 |
+
]
|
| 418 |
+
```
|
| 419 |
+
|
| 420 |
+
Regarding the above dataset, the *dataset description* in `dataset_info.json` should be:
|
| 421 |
+
|
| 422 |
+
```json
|
| 423 |
+
"dataset_name": {
|
| 424 |
+
"file_name": "data.json",
|
| 425 |
+
"formatting": "sharegpt",
|
| 426 |
+
"columns": {
|
| 427 |
+
"messages": "conversations",
|
| 428 |
+
"audios": "audios"
|
| 429 |
+
}
|
| 430 |
+
}
|
| 431 |
+
```
|
| 432 |
+
|
| 433 |
+
### OpenAI Format
|
| 434 |
+
|
| 435 |
+
The openai format is simply a special case of the sharegpt format, where the first message may be a system prompt.
|
| 436 |
+
|
| 437 |
+
```json
|
| 438 |
+
[
|
| 439 |
+
{
|
| 440 |
+
"messages": [
|
| 441 |
+
{
|
| 442 |
+
"role": "system",
|
| 443 |
+
"content": "system prompt (optional)"
|
| 444 |
+
},
|
| 445 |
+
{
|
| 446 |
+
"role": "user",
|
| 447 |
+
"content": "user instruction"
|
| 448 |
+
},
|
| 449 |
+
{
|
| 450 |
+
"role": "assistant",
|
| 451 |
+
"content": "model response"
|
| 452 |
+
}
|
| 453 |
+
]
|
| 454 |
+
}
|
| 455 |
+
]
|
| 456 |
+
```
|
| 457 |
+
|
| 458 |
+
Regarding the above dataset, the *dataset description* in `dataset_info.json` should be:
|
| 459 |
+
|
| 460 |
+
```json
|
| 461 |
+
"dataset_name": {
|
| 462 |
+
"file_name": "data.json",
|
| 463 |
+
"formatting": "sharegpt",
|
| 464 |
+
"columns": {
|
| 465 |
+
"messages": "messages"
|
| 466 |
+
},
|
| 467 |
+
"tags": {
|
| 468 |
+
"role_tag": "role",
|
| 469 |
+
"content_tag": "content",
|
| 470 |
+
"user_tag": "user",
|
| 471 |
+
"assistant_tag": "assistant",
|
| 472 |
+
"system_tag": "system"
|
| 473 |
+
}
|
| 474 |
+
}
|
| 475 |
+
```
|
data/README_zh.md
ADDED
|
@@ -0,0 +1,478 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[dataset_info.json](dataset_info.json) 包含了所有可用的数据集。如果您希望使用自定义数据集,请**务必**在 `dataset_info.json` 文件中添加*数据集描述*,并通过修改 `dataset: 数据集名称` 配置来使用数据集。
|
| 2 |
+
|
| 3 |
+
其中 `dataset_info.json` 文件应放置在 `dataset_dir` 目录下。您可以通过修改 `dataset_dir` 参数来使用其他目录。默认值为 `./data`。
|
| 4 |
+
|
| 5 |
+
目前我们支持 **alpaca** 格式和 **sharegpt** 格式的数据集。允许的文件类型包括 json、jsonl、csv、parquet 和 arrow。
|
| 6 |
+
|
| 7 |
+
```json
|
| 8 |
+
"数据集名称": {
|
| 9 |
+
"hf_hub_url": "Hugging Face 的数据集仓库地址(若指定,则忽略 script_url 和 file_name)",
|
| 10 |
+
"ms_hub_url": "ModelScope 的数据集仓库地址(若指定,则忽略 script_url 和 file_name)",
|
| 11 |
+
"script_url": "包含数据加载脚本的本地文件夹名称(若指定,则忽略 file_name)",
|
| 12 |
+
"file_name": "该目录下数据集文件夹或文件的名称(若上述参数未指定,则此项必需)",
|
| 13 |
+
"formatting": "数据集格式(可选,默认:alpaca,可以为 alpaca 或 sharegpt)",
|
| 14 |
+
"ranking": "是否为偏好数据集(可选,默认:False)",
|
| 15 |
+
"subset": "数据集子集的名称(可选,默认:None)",
|
| 16 |
+
"split": "所使用的数据集切分(可选,默认:train)",
|
| 17 |
+
"folder": "Hugging Face 仓库的文件夹名称(可选,默认:None)",
|
| 18 |
+
"num_samples": "该数据集所使用的样本数量。(可选,默认:None)",
|
| 19 |
+
"columns(可选)": {
|
| 20 |
+
"prompt": "数据集代表提示词的表头名称(默认:instruction)",
|
| 21 |
+
"query": "数据集代表请求的表头名称(默认:input)",
|
| 22 |
+
"response": "数据集代表回答的表头名称(默认:output)",
|
| 23 |
+
"history": "数据集代表历史对话的表头名称(默认:None)",
|
| 24 |
+
"messages": "数据集代表消息列表的表头名称(默认:conversations)",
|
| 25 |
+
"system": "数据集代表系统提示的表头名称(默认:None)",
|
| 26 |
+
"tools": "数据集代表工具描述的表头名称(默认:None)",
|
| 27 |
+
"images": "数据集代表图像输入的表头名称(默认:None)",
|
| 28 |
+
"videos": "数据集代表视频输入的表头名称(默认:None)",
|
| 29 |
+
"audios": "数据集代表音频输入的表头名称(默认:None)",
|
| 30 |
+
"chosen": "数据集代表更优回答的表头名称(默认:None)",
|
| 31 |
+
"rejected": "数据集代表更差回答的表头名称(默认:None)",
|
| 32 |
+
"kto_tag": "数据集代表 KTO 标签的表头名称(默认:None)"
|
| 33 |
+
},
|
| 34 |
+
"tags(可选,用于 sharegpt 格式)": {
|
| 35 |
+
"role_tag": "消息中代表发送者身份的键名(默认:from)",
|
| 36 |
+
"content_tag": "消息中代表文本内容的键名(默认:value)",
|
| 37 |
+
"user_tag": "消息中代表用户的 role_tag(默认:human)",
|
| 38 |
+
"assistant_tag": "消息中代表助手的 role_tag(默认:gpt)",
|
| 39 |
+
"observation_tag": "消息中代表工具返回结果的 role_tag(默认:observation)",
|
| 40 |
+
"function_tag": "消息中代表工具调用的 role_tag(默认:function_call)",
|
| 41 |
+
"system_tag": "消息中代表系统提示的 role_tag(默认:system,会覆盖 system column)"
|
| 42 |
+
}
|
| 43 |
+
}
|
| 44 |
+
```
|
| 45 |
+
|
| 46 |
+
## Alpaca 格式
|
| 47 |
+
|
| 48 |
+
### 指令监督微调数据集
|
| 49 |
+
|
| 50 |
+
- [样例数据集](alpaca_zh_demo.json)
|
| 51 |
+
|
| 52 |
+
在指令监督微调时,`instruction` 列对应的内容会与 `input` 列对应的内容拼接后作为提示词,即提示词为 `instruction\ninput`。而 `output` 列对应的内容为模型回答。
|
| 53 |
+
|
| 54 |
+
对于推理类模型的微调,如果数据集包含思维链,则需要把思维链放在模型回答中,例如 `<think>cot</think>output`。
|
| 55 |
+
|
| 56 |
+
如果指定,`system` 列对应的内容将被作为系统提示词。
|
| 57 |
+
|
| 58 |
+
`history` 列是由多个字符串二元组构成的列表,分别代表历史消息中每轮对话的指令和回答。注意在指令监督微调时,历史消息中的回答内容**也会被用于模型学习**。
|
| 59 |
+
|
| 60 |
+
```json
|
| 61 |
+
[
|
| 62 |
+
{
|
| 63 |
+
"instruction": "用户指令(必填)",
|
| 64 |
+
"input": "用户输入(选填)",
|
| 65 |
+
"output": "模型回答(必填)",
|
| 66 |
+
"system": "系统提示词(选填)",
|
| 67 |
+
"history": [
|
| 68 |
+
["第一轮指令(选填)", "第一轮回答(选填)"],
|
| 69 |
+
["第二轮指令(选填)", "第二轮回答(选填)"]
|
| 70 |
+
]
|
| 71 |
+
}
|
| 72 |
+
]
|
| 73 |
+
```
|
| 74 |
+
|
| 75 |
+
对于上述格式的数据,`dataset_info.json` 中的*数据集描述*应为:
|
| 76 |
+
|
| 77 |
+
```json
|
| 78 |
+
"数据集名称": {
|
| 79 |
+
"file_name": "data.json",
|
| 80 |
+
"columns": {
|
| 81 |
+
"prompt": "instruction",
|
| 82 |
+
"query": "input",
|
| 83 |
+
"response": "output",
|
| 84 |
+
"system": "system",
|
| 85 |
+
"history": "history"
|
| 86 |
+
}
|
| 87 |
+
}
|
| 88 |
+
```
|
| 89 |
+
|
| 90 |
+
> [!TIP]
|
| 91 |
+
> 如果模型本身具备推理能力(如 Qwen3)而数据集不包含思维链,LLaMA-Factory 会自动为数据添加空思维链。当 `enable_thinking` 为 `True` 时(慢思考,默认),空思维链会添加到模型回答中并且计算损失,否则会添加到用户指令中并且不计算损失(快思考)。请在训练和推理时保�� `enable_thinking` 参数一致。
|
| 92 |
+
>
|
| 93 |
+
> 如果您希望训练包含思维链的数据时使用慢思考,训练不包含思维链的数据时使用快思考,可以设置 `enable_thinking` 为 `None`。但该功能较为复杂,请谨慎使用。
|
| 94 |
+
|
| 95 |
+
### 预训练数据集
|
| 96 |
+
|
| 97 |
+
- [样例数据集](c4_demo.jsonl)
|
| 98 |
+
|
| 99 |
+
在预训练时,只有 `text` 列中的内容会用于模型学习。
|
| 100 |
+
|
| 101 |
+
```json
|
| 102 |
+
[
|
| 103 |
+
{"text": "document"},
|
| 104 |
+
{"text": "document"}
|
| 105 |
+
]
|
| 106 |
+
```
|
| 107 |
+
|
| 108 |
+
对于上述格式的数据,`dataset_info.json` 中的*数据集描述*应为:
|
| 109 |
+
|
| 110 |
+
```json
|
| 111 |
+
"数据集名称": {
|
| 112 |
+
"file_name": "data.json",
|
| 113 |
+
"columns": {
|
| 114 |
+
"prompt": "text"
|
| 115 |
+
}
|
| 116 |
+
}
|
| 117 |
+
```
|
| 118 |
+
|
| 119 |
+
### 偏好数据集
|
| 120 |
+
|
| 121 |
+
偏好数据集用于奖励模型训练、DPO 训练、ORPO 训练和 SimPO 训练。
|
| 122 |
+
|
| 123 |
+
它需要在 `chosen` 列中提供更优的回答,并在 `rejected` 列中提供更差的回答。
|
| 124 |
+
|
| 125 |
+
```json
|
| 126 |
+
[
|
| 127 |
+
{
|
| 128 |
+
"instruction": "用户指令(必填)",
|
| 129 |
+
"input": "用户输入(选填)",
|
| 130 |
+
"chosen": "优质回答(必填)",
|
| 131 |
+
"rejected": "劣质回答(必填)"
|
| 132 |
+
}
|
| 133 |
+
]
|
| 134 |
+
```
|
| 135 |
+
|
| 136 |
+
对于上述格式的数据,`dataset_info.json` 中的*数据集描述*应为:
|
| 137 |
+
|
| 138 |
+
```json
|
| 139 |
+
"数据集名称": {
|
| 140 |
+
"file_name": "data.json",
|
| 141 |
+
"ranking": true,
|
| 142 |
+
"columns": {
|
| 143 |
+
"prompt": "instruction",
|
| 144 |
+
"query": "input",
|
| 145 |
+
"chosen": "chosen",
|
| 146 |
+
"rejected": "rejected"
|
| 147 |
+
}
|
| 148 |
+
}
|
| 149 |
+
```
|
| 150 |
+
|
| 151 |
+
### KTO 数据集
|
| 152 |
+
|
| 153 |
+
KTO 数据集需要提供额外的 `kto_tag` 列。详情请参阅 [sharegpt](#sharegpt-格式)。
|
| 154 |
+
|
| 155 |
+
### 多模态图像数据集
|
| 156 |
+
|
| 157 |
+
多模态图像数据集需要提供额外的 `images` 列。详情请参阅 [sharegpt](#sharegpt-格式)。
|
| 158 |
+
|
| 159 |
+
### 多模态视频数据集
|
| 160 |
+
|
| 161 |
+
多模态视频数据集需要提供额外的 `videos` 列。详情请参阅 [sharegpt](#sharegpt-格式)。
|
| 162 |
+
|
| 163 |
+
### 多模态音频数据集
|
| 164 |
+
|
| 165 |
+
多模态音频数据集需要提供额外的 `audios` 列。详情请参阅 [sharegpt](#sharegpt-格式)。
|
| 166 |
+
|
| 167 |
+
## Sharegpt 格式
|
| 168 |
+
|
| 169 |
+
### 指令监督微调数据集
|
| 170 |
+
|
| 171 |
+
- [样例数据集](glaive_toolcall_zh_demo.json)
|
| 172 |
+
|
| 173 |
+
相比 alpaca 格式的数据集,sharegpt 格式支持**更多的角色种类**,例如 human、gpt、observation、function 等等。它们构成一个对象列表呈现在 `conversations` 列中。
|
| 174 |
+
|
| 175 |
+
注意其中 human 和 observation 必须出现在奇数位置,gpt 和 function 必须出现在偶数位置。默认所有的 gpt 和 function 会被用于学习。
|
| 176 |
+
|
| 177 |
+
```json
|
| 178 |
+
[
|
| 179 |
+
{
|
| 180 |
+
"conversations": [
|
| 181 |
+
{
|
| 182 |
+
"from": "human",
|
| 183 |
+
"value": "用户指令"
|
| 184 |
+
},
|
| 185 |
+
{
|
| 186 |
+
"from": "function_call",
|
| 187 |
+
"value": "工具参数"
|
| 188 |
+
},
|
| 189 |
+
{
|
| 190 |
+
"from": "observation",
|
| 191 |
+
"value": "工具结果"
|
| 192 |
+
},
|
| 193 |
+
{
|
| 194 |
+
"from": "gpt",
|
| 195 |
+
"value": "模型回答"
|
| 196 |
+
}
|
| 197 |
+
],
|
| 198 |
+
"system": "系统提示词(选填)",
|
| 199 |
+
"tools": "工具描述(选填)"
|
| 200 |
+
}
|
| 201 |
+
]
|
| 202 |
+
```
|
| 203 |
+
|
| 204 |
+
对于上述格式的数据,`dataset_info.json` 中的*数据集描述*应为:
|
| 205 |
+
|
| 206 |
+
```json
|
| 207 |
+
"数据集名称": {
|
| 208 |
+
"file_name": "data.json",
|
| 209 |
+
"formatting": "sharegpt",
|
| 210 |
+
"columns": {
|
| 211 |
+
"messages": "conversations",
|
| 212 |
+
"system": "system",
|
| 213 |
+
"tools": "tools"
|
| 214 |
+
}
|
| 215 |
+
}
|
| 216 |
+
```
|
| 217 |
+
|
| 218 |
+
### 预训练数据集
|
| 219 |
+
|
| 220 |
+
尚不支持,请使用 [alpaca](#alpaca-格式) 格式。
|
| 221 |
+
|
| 222 |
+
### 偏好数据集
|
| 223 |
+
|
| 224 |
+
- [样例数据集](dpo_zh_demo.json)
|
| 225 |
+
|
| 226 |
+
Sharegpt 格式的偏好数据集同样需要在 `chosen` 列中提供更优的消息,并在 `rejected` 列中提供更差的消息。
|
| 227 |
+
|
| 228 |
+
```json
|
| 229 |
+
[
|
| 230 |
+
{
|
| 231 |
+
"conversations": [
|
| 232 |
+
{
|
| 233 |
+
"from": "human",
|
| 234 |
+
"value": "用户指令"
|
| 235 |
+
},
|
| 236 |
+
{
|
| 237 |
+
"from": "gpt",
|
| 238 |
+
"value": "模型回答"
|
| 239 |
+
},
|
| 240 |
+
{
|
| 241 |
+
"from": "human",
|
| 242 |
+
"value": "用户指令"
|
| 243 |
+
}
|
| 244 |
+
],
|
| 245 |
+
"chosen": {
|
| 246 |
+
"from": "gpt",
|
| 247 |
+
"value": "优质回答"
|
| 248 |
+
},
|
| 249 |
+
"rejected": {
|
| 250 |
+
"from": "gpt",
|
| 251 |
+
"value": "劣质回答"
|
| 252 |
+
}
|
| 253 |
+
}
|
| 254 |
+
]
|
| 255 |
+
```
|
| 256 |
+
|
| 257 |
+
对于上述格式的数据,`dataset_info.json` 中的*数据集描述*应为:
|
| 258 |
+
|
| 259 |
+
```json
|
| 260 |
+
"数据集名称": {
|
| 261 |
+
"file_name": "data.json",
|
| 262 |
+
"formatting": "sharegpt",
|
| 263 |
+
"ranking": true,
|
| 264 |
+
"columns": {
|
| 265 |
+
"messages": "conversations",
|
| 266 |
+
"chosen": "chosen",
|
| 267 |
+
"rejected": "rejected"
|
| 268 |
+
}
|
| 269 |
+
}
|
| 270 |
+
```
|
| 271 |
+
|
| 272 |
+
### KTO 数据集
|
| 273 |
+
|
| 274 |
+
- [样例数据集](kto_en_demo.json)
|
| 275 |
+
|
| 276 |
+
KTO 数据集需要额外添加一个 `kto_tag` 列,包含 bool 类型的人类反馈。
|
| 277 |
+
|
| 278 |
+
```json
|
| 279 |
+
[
|
| 280 |
+
{
|
| 281 |
+
"conversations": [
|
| 282 |
+
{
|
| 283 |
+
"from": "human",
|
| 284 |
+
"value": "用户指令"
|
| 285 |
+
},
|
| 286 |
+
{
|
| 287 |
+
"from": "gpt",
|
| 288 |
+
"value": "模型回答"
|
| 289 |
+
}
|
| 290 |
+
],
|
| 291 |
+
"kto_tag": "人类反馈 [true/false](必填)"
|
| 292 |
+
}
|
| 293 |
+
]
|
| 294 |
+
```
|
| 295 |
+
|
| 296 |
+
对于上述格式的数据,`dataset_info.json` 中的*数据集描述*应为:
|
| 297 |
+
|
| 298 |
+
```json
|
| 299 |
+
"数据集名称": {
|
| 300 |
+
"file_name": "data.json",
|
| 301 |
+
"formatting": "sharegpt",
|
| 302 |
+
"columns": {
|
| 303 |
+
"messages": "conversations",
|
| 304 |
+
"kto_tag": "kto_tag"
|
| 305 |
+
}
|
| 306 |
+
}
|
| 307 |
+
```
|
| 308 |
+
|
| 309 |
+
### 多模态图像数据集
|
| 310 |
+
|
| 311 |
+
- [样例数据集](mllm_demo.json)
|
| 312 |
+
|
| 313 |
+
多模态图像数据集需要额外添加一个 `images` 列,包含输入图像的路径。
|
| 314 |
+
|
| 315 |
+
注���图片的数量必须与文本中所有 `<image>` 标记的数量严格一致。
|
| 316 |
+
|
| 317 |
+
```json
|
| 318 |
+
[
|
| 319 |
+
{
|
| 320 |
+
"conversations": [
|
| 321 |
+
{
|
| 322 |
+
"from": "human",
|
| 323 |
+
"value": "<image><image>用户指令"
|
| 324 |
+
},
|
| 325 |
+
{
|
| 326 |
+
"from": "gpt",
|
| 327 |
+
"value": "模型回答"
|
| 328 |
+
}
|
| 329 |
+
],
|
| 330 |
+
"images": [
|
| 331 |
+
"图像路径(必填)",
|
| 332 |
+
"图像路径(必填)"
|
| 333 |
+
]
|
| 334 |
+
}
|
| 335 |
+
]
|
| 336 |
+
```
|
| 337 |
+
|
| 338 |
+
对于上述格式的数据,`dataset_info.json` 中的*数据集描述*应为:
|
| 339 |
+
|
| 340 |
+
```json
|
| 341 |
+
"数据集名称": {
|
| 342 |
+
"file_name": "data.json",
|
| 343 |
+
"formatting": "sharegpt",
|
| 344 |
+
"columns": {
|
| 345 |
+
"messages": "conversations",
|
| 346 |
+
"images": "images"
|
| 347 |
+
}
|
| 348 |
+
}
|
| 349 |
+
```
|
| 350 |
+
|
| 351 |
+
### 多模态视频数据集
|
| 352 |
+
|
| 353 |
+
- [样例数据集](mllm_video_demo.json)
|
| 354 |
+
|
| 355 |
+
多模态视频数据集需要额外添加一个 `videos` 列,包含输入视频的路径。
|
| 356 |
+
|
| 357 |
+
注意视频的数量必须与文本中所有 `<video>` 标记的数量严格一致。
|
| 358 |
+
|
| 359 |
+
```json
|
| 360 |
+
[
|
| 361 |
+
{
|
| 362 |
+
"conversations": [
|
| 363 |
+
{
|
| 364 |
+
"from": "human",
|
| 365 |
+
"value": "<video><video>用户指令"
|
| 366 |
+
},
|
| 367 |
+
{
|
| 368 |
+
"from": "gpt",
|
| 369 |
+
"value": "模型回答"
|
| 370 |
+
}
|
| 371 |
+
],
|
| 372 |
+
"videos": [
|
| 373 |
+
"视频路径(必填)",
|
| 374 |
+
"视频路径(必填)"
|
| 375 |
+
]
|
| 376 |
+
}
|
| 377 |
+
]
|
| 378 |
+
```
|
| 379 |
+
|
| 380 |
+
对于上述格式的数据,`dataset_info.json` 中的*数据集描述*应为:
|
| 381 |
+
|
| 382 |
+
```json
|
| 383 |
+
"数据集名称": {
|
| 384 |
+
"file_name": "data.json",
|
| 385 |
+
"formatting": "sharegpt",
|
| 386 |
+
"columns": {
|
| 387 |
+
"messages": "conversations",
|
| 388 |
+
"videos": "videos"
|
| 389 |
+
}
|
| 390 |
+
}
|
| 391 |
+
```
|
| 392 |
+
|
| 393 |
+
### 多模态音频数据集
|
| 394 |
+
|
| 395 |
+
- [样例数据集](mllm_audio_demo.json)
|
| 396 |
+
|
| 397 |
+
多模态音频数据集需要额外添加一个 `audios` 列,包含输入音频的路径。
|
| 398 |
+
|
| 399 |
+
注意音频的数量必须与文本中所有 `<audio>` 标记的数量严格一致。
|
| 400 |
+
|
| 401 |
+
```json
|
| 402 |
+
[
|
| 403 |
+
{
|
| 404 |
+
"conversations": [
|
| 405 |
+
{
|
| 406 |
+
"from": "human",
|
| 407 |
+
"value": "<audio><audio>用户指令"
|
| 408 |
+
},
|
| 409 |
+
{
|
| 410 |
+
"from": "gpt",
|
| 411 |
+
"value": "模型回答"
|
| 412 |
+
}
|
| 413 |
+
],
|
| 414 |
+
"audios": [
|
| 415 |
+
"音频路径(必填)",
|
| 416 |
+
"音频路径(必填)"
|
| 417 |
+
]
|
| 418 |
+
}
|
| 419 |
+
]
|
| 420 |
+
```
|
| 421 |
+
|
| 422 |
+
对于上述格式的数据,`dataset_info.json` 中的*数据集描述*应为:
|
| 423 |
+
|
| 424 |
+
```json
|
| 425 |
+
"数据集名称": {
|
| 426 |
+
"file_name": "data.json",
|
| 427 |
+
"formatting": "sharegpt",
|
| 428 |
+
"columns": {
|
| 429 |
+
"messages": "conversations",
|
| 430 |
+
"audios": "audios"
|
| 431 |
+
}
|
| 432 |
+
}
|
| 433 |
+
```
|
| 434 |
+
|
| 435 |
+
|
| 436 |
+
### OpenAI 格式
|
| 437 |
+
|
| 438 |
+
OpenAI 格式仅仅是 sharegpt 格式的一种特殊情况,其中第一条消息可能是系统提示词。
|
| 439 |
+
|
| 440 |
+
```json
|
| 441 |
+
[
|
| 442 |
+
{
|
| 443 |
+
"messages": [
|
| 444 |
+
{
|
| 445 |
+
"role": "system",
|
| 446 |
+
"content": "系统提示词(选填)"
|
| 447 |
+
},
|
| 448 |
+
{
|
| 449 |
+
"role": "user",
|
| 450 |
+
"content": "用户指令"
|
| 451 |
+
},
|
| 452 |
+
{
|
| 453 |
+
"role": "assistant",
|
| 454 |
+
"content": "模型回答"
|
| 455 |
+
}
|
| 456 |
+
]
|
| 457 |
+
}
|
| 458 |
+
]
|
| 459 |
+
```
|
| 460 |
+
|
| 461 |
+
对于上述格式的数据,`dataset_info.json` 中的*数据集描述*应为:
|
| 462 |
+
|
| 463 |
+
```json
|
| 464 |
+
"数据集名称": {
|
| 465 |
+
"file_name": "data.json",
|
| 466 |
+
"formatting": "sharegpt",
|
| 467 |
+
"columns": {
|
| 468 |
+
"messages": "messages"
|
| 469 |
+
},
|
| 470 |
+
"tags": {
|
| 471 |
+
"role_tag": "role",
|
| 472 |
+
"content_tag": "content",
|
| 473 |
+
"user_tag": "user",
|
| 474 |
+
"assistant_tag": "assistant",
|
| 475 |
+
"system_tag": "system"
|
| 476 |
+
}
|
| 477 |
+
}
|
| 478 |
+
```
|
data/alpaca_en_demo.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/alpaca_zh_demo.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/c4_demo.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/convert_hapticcap_to_llava.py
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import json
|
| 2 |
+
import random
|
| 3 |
+
import glob
|
| 4 |
+
import os
|
| 5 |
+
|
| 6 |
+
# === Prompt 组 ===
|
| 7 |
+
prompts = {
|
| 8 |
+
"sensory": [
|
| 9 |
+
"What does this vibration physically feel like?",
|
| 10 |
+
"Describe the physical sensation produced by this vibration.",
|
| 11 |
+
"How would you characterize the tactile feeling of this vibration?",
|
| 12 |
+
"What kind of physical texture or movement does this vibration create?",
|
| 13 |
+
"In terms of touch, how does this vibration feel on the skin?"
|
| 14 |
+
],
|
| 15 |
+
"emotional": [
|
| 16 |
+
"What emotion or mood does this vibration convey?",
|
| 17 |
+
"How does this vibration make you feel emotionally?",
|
| 18 |
+
"What emotional tone or atmosphere is expressed by this vibration?",
|
| 19 |
+
"Describe the emotional impression that this vibration gives.",
|
| 20 |
+
"What kind of mood or feeling is evoked by this vibration?"
|
| 21 |
+
],
|
| 22 |
+
"associative": [
|
| 23 |
+
"What real-world sensation or object does this vibration resemble?",
|
| 24 |
+
"What familiar experience or phenomenon does this vibration remind you of?",
|
| 25 |
+
"Describe what this vibration is similar to in the real world.",
|
| 26 |
+
"What everyday sound, movement, or event could this vibration represent?",
|
| 27 |
+
"What real-life action or object feels most like this vibration?"
|
| 28 |
+
]
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
# === 加载原始数据 ===
|
| 32 |
+
with open("data/HapticCap/signal_map_5.1.json", "r", encoding="utf-8") as f:
|
| 33 |
+
raw_data = json.load(f)
|
| 34 |
+
|
| 35 |
+
llava_data = []
|
| 36 |
+
base_dir = "data/HapticCap/aug_signal"
|
| 37 |
+
|
| 38 |
+
for sample_id, sample_content in raw_data.items():
|
| 39 |
+
if not isinstance(sample_content, dict):
|
| 40 |
+
continue
|
| 41 |
+
|
| 42 |
+
# 匹配音频文件(可能有多个 augmentation)
|
| 43 |
+
pattern = os.path.join(base_dir, f"F{sample_id}_loop*.wav")
|
| 44 |
+
matched_files = sorted(glob.glob(pattern)) # sorted 保证可复现顺序
|
| 45 |
+
if not matched_files:
|
| 46 |
+
# 如果找不到音频文件则跳过该 sample_id
|
| 47 |
+
continue
|
| 48 |
+
|
| 49 |
+
for audio_path in matched_files:
|
| 50 |
+
# 为每个匹配到的音频都生成条目(后续会根据 user_entry 生成多条)
|
| 51 |
+
for user_id, user_entry in sample_content.items():
|
| 52 |
+
if not isinstance(user_entry, dict):
|
| 53 |
+
continue
|
| 54 |
+
|
| 55 |
+
for modality, key in zip(
|
| 56 |
+
["sensory", "emotional", "associative"],
|
| 57 |
+
["free_text_sensory", "free_text_emotional", "free_text_association"]
|
| 58 |
+
):
|
| 59 |
+
raw_text = user_entry.get(key, "")
|
| 60 |
+
if not isinstance(raw_text, str):
|
| 61 |
+
continue
|
| 62 |
+
text = raw_text.strip()
|
| 63 |
+
if not text or text.lower() in ["n.a.", "na", "none"]:
|
| 64 |
+
continue
|
| 65 |
+
|
| 66 |
+
conv = [
|
| 67 |
+
{"from": "human", "value": "<audio>"+random.choice(prompts[modality])},
|
| 68 |
+
{"from": "gpt", "value": text}
|
| 69 |
+
]
|
| 70 |
+
|
| 71 |
+
llava_data.append({
|
| 72 |
+
"audios": audio_path.strip('data/'),
|
| 73 |
+
"conversations": conv
|
| 74 |
+
})
|
| 75 |
+
|
| 76 |
+
# === 保存为 JSONL ===
|
| 77 |
+
out_path = "data/HapticCap/haptic_llava.json"
|
| 78 |
+
with open(out_path, "w", encoding="utf-8") as f:
|
| 79 |
+
json.dump(llava_data, f, ensure_ascii=False, indent=2)
|
| 80 |
+
|
| 81 |
+
print(f"✅ Saved {len(llava_data)} samples to {out_path}")
|
data/dataset_info.json
ADDED
|
@@ -0,0 +1,766 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"identity": {
|
| 3 |
+
"file_name": "identity.json"
|
| 4 |
+
},
|
| 5 |
+
"alpaca_en_demo": {
|
| 6 |
+
"file_name": "alpaca_en_demo.json"
|
| 7 |
+
},
|
| 8 |
+
"alpaca_zh_demo": {
|
| 9 |
+
"file_name": "alpaca_zh_demo.json"
|
| 10 |
+
},
|
| 11 |
+
"glaive_toolcall_en_demo": {
|
| 12 |
+
"file_name": "glaive_toolcall_en_demo.json",
|
| 13 |
+
"formatting": "sharegpt",
|
| 14 |
+
"columns": {
|
| 15 |
+
"messages": "conversations",
|
| 16 |
+
"tools": "tools"
|
| 17 |
+
}
|
| 18 |
+
},
|
| 19 |
+
"glaive_toolcall_zh_demo": {
|
| 20 |
+
"file_name": "glaive_toolcall_zh_demo.json",
|
| 21 |
+
"formatting": "sharegpt",
|
| 22 |
+
"columns": {
|
| 23 |
+
"messages": "conversations",
|
| 24 |
+
"tools": "tools"
|
| 25 |
+
}
|
| 26 |
+
},
|
| 27 |
+
"mllm_demo": {
|
| 28 |
+
"file_name": "mllm_demo.json",
|
| 29 |
+
"formatting": "sharegpt",
|
| 30 |
+
"columns": {
|
| 31 |
+
"messages": "messages",
|
| 32 |
+
"images": "images"
|
| 33 |
+
},
|
| 34 |
+
"tags": {
|
| 35 |
+
"role_tag": "role",
|
| 36 |
+
"content_tag": "content",
|
| 37 |
+
"user_tag": "user",
|
| 38 |
+
"assistant_tag": "assistant"
|
| 39 |
+
}
|
| 40 |
+
},
|
| 41 |
+
"hapticcap": {
|
| 42 |
+
"file_name": "HapticCap/haptic_llava.json",
|
| 43 |
+
"formatting": "sharegpt",
|
| 44 |
+
"columns": {
|
| 45 |
+
"messages": "conversations",
|
| 46 |
+
"audios": "audios"
|
| 47 |
+
}
|
| 48 |
+
},
|
| 49 |
+
"scan2cap_train_32frames": {
|
| 50 |
+
"file_name": "VG-LLM-train/scan2cap_train_32frames.json",
|
| 51 |
+
"formatting": "sharegpt",
|
| 52 |
+
"columns": {
|
| 53 |
+
"messages": "conversations",
|
| 54 |
+
"images": "images"
|
| 55 |
+
}
|
| 56 |
+
},
|
| 57 |
+
"scannet_det_train_4frames": {
|
| 58 |
+
"file_name": "VG-LLM-train/scannet_det_train_4frames.json",
|
| 59 |
+
"formatting": "sharegpt",
|
| 60 |
+
"columns": {
|
| 61 |
+
"messages": "conversations",
|
| 62 |
+
"images": "images"
|
| 63 |
+
}
|
| 64 |
+
},
|
| 65 |
+
"scanrefer_train_32frames": {
|
| 66 |
+
"file_name": "VG-LLM-train/scanrefer_train_32frames.json",
|
| 67 |
+
"formatting": "sharegpt",
|
| 68 |
+
"columns": {
|
| 69 |
+
"messages": "conversations",
|
| 70 |
+
"images": "images"
|
| 71 |
+
}
|
| 72 |
+
},
|
| 73 |
+
"mllm_audio_demo": {
|
| 74 |
+
"file_name": "mllm_audio_demo.json",
|
| 75 |
+
"formatting": "sharegpt",
|
| 76 |
+
"columns": {
|
| 77 |
+
"messages": "messages",
|
| 78 |
+
"audios": "audios"
|
| 79 |
+
},
|
| 80 |
+
"tags": {
|
| 81 |
+
"role_tag": "role",
|
| 82 |
+
"content_tag": "content",
|
| 83 |
+
"user_tag": "user",
|
| 84 |
+
"assistant_tag": "assistant"
|
| 85 |
+
}
|
| 86 |
+
},
|
| 87 |
+
"mllm_video_demo": {
|
| 88 |
+
"file_name": "mllm_video_demo.json",
|
| 89 |
+
"formatting": "sharegpt",
|
| 90 |
+
"columns": {
|
| 91 |
+
"messages": "messages",
|
| 92 |
+
"videos": "videos"
|
| 93 |
+
},
|
| 94 |
+
"tags": {
|
| 95 |
+
"role_tag": "role",
|
| 96 |
+
"content_tag": "content",
|
| 97 |
+
"user_tag": "user",
|
| 98 |
+
"assistant_tag": "assistant"
|
| 99 |
+
}
|
| 100 |
+
},
|
| 101 |
+
"mllm_video_audio_demo": {
|
| 102 |
+
"file_name": "mllm_video_audio_demo.json",
|
| 103 |
+
"formatting": "sharegpt",
|
| 104 |
+
"columns": {
|
| 105 |
+
"messages": "messages",
|
| 106 |
+
"videos": "videos",
|
| 107 |
+
"audios": "audios"
|
| 108 |
+
},
|
| 109 |
+
"tags": {
|
| 110 |
+
"role_tag": "role",
|
| 111 |
+
"content_tag": "content",
|
| 112 |
+
"user_tag": "user",
|
| 113 |
+
"assistant_tag": "assistant"
|
| 114 |
+
}
|
| 115 |
+
},
|
| 116 |
+
"alpaca_en": {
|
| 117 |
+
"hf_hub_url": "llamafactory/alpaca_en",
|
| 118 |
+
"ms_hub_url": "llamafactory/alpaca_en",
|
| 119 |
+
"om_hub_url": "HaM/alpaca_en"
|
| 120 |
+
},
|
| 121 |
+
"alpaca_zh": {
|
| 122 |
+
"hf_hub_url": "llamafactory/alpaca_zh",
|
| 123 |
+
"ms_hub_url": "llamafactory/alpaca_zh"
|
| 124 |
+
},
|
| 125 |
+
"alpaca_gpt4_en": {
|
| 126 |
+
"hf_hub_url": "llamafactory/alpaca_gpt4_en",
|
| 127 |
+
"ms_hub_url": "llamafactory/alpaca_gpt4_en"
|
| 128 |
+
},
|
| 129 |
+
"alpaca_gpt4_zh": {
|
| 130 |
+
"hf_hub_url": "llamafactory/alpaca_gpt4_zh",
|
| 131 |
+
"ms_hub_url": "llamafactory/alpaca_gpt4_zh",
|
| 132 |
+
"om_hub_url": "State_Cloud/alpaca-gpt4-data-zh"
|
| 133 |
+
},
|
| 134 |
+
"glaive_toolcall_en": {
|
| 135 |
+
"hf_hub_url": "llamafactory/glaive_toolcall_en",
|
| 136 |
+
"formatting": "sharegpt",
|
| 137 |
+
"columns": {
|
| 138 |
+
"messages": "conversations",
|
| 139 |
+
"tools": "tools"
|
| 140 |
+
}
|
| 141 |
+
},
|
| 142 |
+
"glaive_toolcall_zh": {
|
| 143 |
+
"hf_hub_url": "llamafactory/glaive_toolcall_zh",
|
| 144 |
+
"formatting": "sharegpt",
|
| 145 |
+
"columns": {
|
| 146 |
+
"messages": "conversations",
|
| 147 |
+
"tools": "tools"
|
| 148 |
+
}
|
| 149 |
+
},
|
| 150 |
+
"lima": {
|
| 151 |
+
"hf_hub_url": "llamafactory/lima",
|
| 152 |
+
"formatting": "sharegpt"
|
| 153 |
+
},
|
| 154 |
+
"guanaco": {
|
| 155 |
+
"hf_hub_url": "JosephusCheung/GuanacoDataset",
|
| 156 |
+
"ms_hub_url": "AI-ModelScope/GuanacoDataset"
|
| 157 |
+
},
|
| 158 |
+
"belle_2m": {
|
| 159 |
+
"hf_hub_url": "BelleGroup/train_2M_CN",
|
| 160 |
+
"ms_hub_url": "AI-ModelScope/train_2M_CN"
|
| 161 |
+
},
|
| 162 |
+
"belle_1m": {
|
| 163 |
+
"hf_hub_url": "BelleGroup/train_1M_CN",
|
| 164 |
+
"ms_hub_url": "AI-ModelScope/train_1M_CN"
|
| 165 |
+
},
|
| 166 |
+
"belle_0.5m": {
|
| 167 |
+
"hf_hub_url": "BelleGroup/train_0.5M_CN",
|
| 168 |
+
"ms_hub_url": "AI-ModelScope/train_0.5M_CN"
|
| 169 |
+
},
|
| 170 |
+
"belle_dialog": {
|
| 171 |
+
"hf_hub_url": "BelleGroup/generated_chat_0.4M",
|
| 172 |
+
"ms_hub_url": "AI-ModelScope/generated_chat_0.4M"
|
| 173 |
+
},
|
| 174 |
+
"belle_math": {
|
| 175 |
+
"hf_hub_url": "BelleGroup/school_math_0.25M",
|
| 176 |
+
"ms_hub_url": "AI-ModelScope/school_math_0.25M"
|
| 177 |
+
},
|
| 178 |
+
"open_platypus": {
|
| 179 |
+
"hf_hub_url": "garage-bAInd/Open-Platypus",
|
| 180 |
+
"ms_hub_url": "AI-ModelScope/Open-Platypus"
|
| 181 |
+
},
|
| 182 |
+
"codealpaca": {
|
| 183 |
+
"hf_hub_url": "sahil2801/CodeAlpaca-20k",
|
| 184 |
+
"ms_hub_url": "AI-ModelScope/CodeAlpaca-20k"
|
| 185 |
+
},
|
| 186 |
+
"alpaca_cot": {
|
| 187 |
+
"hf_hub_url": "QingyiSi/Alpaca-CoT",
|
| 188 |
+
"ms_hub_url": "AI-ModelScope/Alpaca-CoT"
|
| 189 |
+
},
|
| 190 |
+
"openorca": {
|
| 191 |
+
"hf_hub_url": "Open-Orca/OpenOrca",
|
| 192 |
+
"ms_hub_url": "AI-ModelScope/OpenOrca",
|
| 193 |
+
"columns": {
|
| 194 |
+
"prompt": "question",
|
| 195 |
+
"response": "response",
|
| 196 |
+
"system": "system_prompt"
|
| 197 |
+
}
|
| 198 |
+
},
|
| 199 |
+
"slimorca": {
|
| 200 |
+
"hf_hub_url": "Open-Orca/SlimOrca",
|
| 201 |
+
"formatting": "sharegpt"
|
| 202 |
+
},
|
| 203 |
+
"mathinstruct": {
|
| 204 |
+
"hf_hub_url": "TIGER-Lab/MathInstruct",
|
| 205 |
+
"ms_hub_url": "AI-ModelScope/MathInstruct",
|
| 206 |
+
"columns": {
|
| 207 |
+
"prompt": "instruction",
|
| 208 |
+
"response": "output"
|
| 209 |
+
}
|
| 210 |
+
},
|
| 211 |
+
"firefly": {
|
| 212 |
+
"hf_hub_url": "YeungNLP/firefly-train-1.1M",
|
| 213 |
+
"columns": {
|
| 214 |
+
"prompt": "input",
|
| 215 |
+
"response": "target"
|
| 216 |
+
}
|
| 217 |
+
},
|
| 218 |
+
"wikiqa": {
|
| 219 |
+
"hf_hub_url": "wiki_qa",
|
| 220 |
+
"columns": {
|
| 221 |
+
"prompt": "question",
|
| 222 |
+
"response": "answer"
|
| 223 |
+
}
|
| 224 |
+
},
|
| 225 |
+
"webqa": {
|
| 226 |
+
"hf_hub_url": "suolyer/webqa",
|
| 227 |
+
"ms_hub_url": "AI-ModelScope/webqa",
|
| 228 |
+
"columns": {
|
| 229 |
+
"prompt": "input",
|
| 230 |
+
"response": "output"
|
| 231 |
+
}
|
| 232 |
+
},
|
| 233 |
+
"webnovel": {
|
| 234 |
+
"hf_hub_url": "zxbsmk/webnovel_cn",
|
| 235 |
+
"ms_hub_url": "AI-ModelScope/webnovel_cn"
|
| 236 |
+
},
|
| 237 |
+
"nectar_sft": {
|
| 238 |
+
"hf_hub_url": "AstraMindAI/SFT-Nectar",
|
| 239 |
+
"ms_hub_url": "AI-ModelScope/SFT-Nectar"
|
| 240 |
+
},
|
| 241 |
+
"deepctrl": {
|
| 242 |
+
"ms_hub_url": "deepctrl/deepctrl-sft-data"
|
| 243 |
+
},
|
| 244 |
+
"adgen_train": {
|
| 245 |
+
"hf_hub_url": "HasturOfficial/adgen",
|
| 246 |
+
"ms_hub_url": "AI-ModelScope/adgen",
|
| 247 |
+
"split": "train",
|
| 248 |
+
"columns": {
|
| 249 |
+
"prompt": "content",
|
| 250 |
+
"response": "summary"
|
| 251 |
+
}
|
| 252 |
+
},
|
| 253 |
+
"adgen_eval": {
|
| 254 |
+
"hf_hub_url": "HasturOfficial/adgen",
|
| 255 |
+
"ms_hub_url": "AI-ModelScope/adgen",
|
| 256 |
+
"split": "validation",
|
| 257 |
+
"columns": {
|
| 258 |
+
"prompt": "content",
|
| 259 |
+
"response": "summary"
|
| 260 |
+
}
|
| 261 |
+
},
|
| 262 |
+
"sharegpt_hyper": {
|
| 263 |
+
"hf_hub_url": "totally-not-an-llm/sharegpt-hyperfiltered-3k",
|
| 264 |
+
"formatting": "sharegpt"
|
| 265 |
+
},
|
| 266 |
+
"sharegpt4": {
|
| 267 |
+
"hf_hub_url": "shibing624/sharegpt_gpt4",
|
| 268 |
+
"ms_hub_url": "AI-ModelScope/sharegpt_gpt4",
|
| 269 |
+
"formatting": "sharegpt"
|
| 270 |
+
},
|
| 271 |
+
"ultrachat_200k": {
|
| 272 |
+
"hf_hub_url": "HuggingFaceH4/ultrachat_200k",
|
| 273 |
+
"ms_hub_url": "AI-ModelScope/ultrachat_200k",
|
| 274 |
+
"split": "train_sft",
|
| 275 |
+
"formatting": "sharegpt",
|
| 276 |
+
"columns": {
|
| 277 |
+
"messages": "messages"
|
| 278 |
+
},
|
| 279 |
+
"tags": {
|
| 280 |
+
"role_tag": "role",
|
| 281 |
+
"content_tag": "content",
|
| 282 |
+
"user_tag": "user",
|
| 283 |
+
"assistant_tag": "assistant"
|
| 284 |
+
}
|
| 285 |
+
},
|
| 286 |
+
"infinity_instruct": {
|
| 287 |
+
"hf_hub_url": "BAAI/Infinity-Instruct",
|
| 288 |
+
"formatting": "sharegpt"
|
| 289 |
+
},
|
| 290 |
+
"agent_instruct": {
|
| 291 |
+
"hf_hub_url": "THUDM/AgentInstruct",
|
| 292 |
+
"ms_hub_url": "ZhipuAI/AgentInstruct",
|
| 293 |
+
"formatting": "sharegpt"
|
| 294 |
+
},
|
| 295 |
+
"lmsys_chat": {
|
| 296 |
+
"hf_hub_url": "lmsys/lmsys-chat-1m",
|
| 297 |
+
"ms_hub_url": "AI-ModelScope/lmsys-chat-1m",
|
| 298 |
+
"formatting": "sharegpt",
|
| 299 |
+
"columns": {
|
| 300 |
+
"messages": "conversation"
|
| 301 |
+
},
|
| 302 |
+
"tags": {
|
| 303 |
+
"role_tag": "role",
|
| 304 |
+
"content_tag": "content",
|
| 305 |
+
"user_tag": "user",
|
| 306 |
+
"assistant_tag": "assistant"
|
| 307 |
+
}
|
| 308 |
+
},
|
| 309 |
+
"evol_instruct": {
|
| 310 |
+
"hf_hub_url": "WizardLM/WizardLM_evol_instruct_V2_196k",
|
| 311 |
+
"ms_hub_url": "AI-ModelScope/WizardLM_evol_instruct_V2_196k",
|
| 312 |
+
"formatting": "sharegpt"
|
| 313 |
+
},
|
| 314 |
+
"glaive_toolcall_100k": {
|
| 315 |
+
"hf_hub_url": "hiyouga/glaive-function-calling-v2-sharegpt",
|
| 316 |
+
"formatting": "sharegpt",
|
| 317 |
+
"columns": {
|
| 318 |
+
"messages": "conversations",
|
| 319 |
+
"tools": "tools"
|
| 320 |
+
}
|
| 321 |
+
},
|
| 322 |
+
"cosmopedia": {
|
| 323 |
+
"hf_hub_url": "HuggingFaceTB/cosmopedia",
|
| 324 |
+
"columns": {
|
| 325 |
+
"prompt": "prompt",
|
| 326 |
+
"response": "text"
|
| 327 |
+
}
|
| 328 |
+
},
|
| 329 |
+
"stem_zh": {
|
| 330 |
+
"hf_hub_url": "hfl/stem_zh_instruction"
|
| 331 |
+
},
|
| 332 |
+
"ruozhiba_gpt4": {
|
| 333 |
+
"hf_hub_url": "hfl/ruozhiba_gpt4_turbo"
|
| 334 |
+
},
|
| 335 |
+
"neo_sft": {
|
| 336 |
+
"hf_hub_url": "m-a-p/neo_sft_phase2",
|
| 337 |
+
"formatting": "sharegpt"
|
| 338 |
+
},
|
| 339 |
+
"magpie_pro_300k": {
|
| 340 |
+
"hf_hub_url": "Magpie-Align/Magpie-Pro-300K-Filtered",
|
| 341 |
+
"formatting": "sharegpt"
|
| 342 |
+
},
|
| 343 |
+
"magpie_ultra": {
|
| 344 |
+
"hf_hub_url": "argilla/magpie-ultra-v0.1",
|
| 345 |
+
"columns": {
|
| 346 |
+
"prompt": "instruction",
|
| 347 |
+
"response": "response"
|
| 348 |
+
}
|
| 349 |
+
},
|
| 350 |
+
"web_instruct": {
|
| 351 |
+
"hf_hub_url": "TIGER-Lab/WebInstructSub",
|
| 352 |
+
"columns": {
|
| 353 |
+
"prompt": "question",
|
| 354 |
+
"response": "answer"
|
| 355 |
+
}
|
| 356 |
+
},
|
| 357 |
+
"openo1_sft": {
|
| 358 |
+
"hf_hub_url": "llamafactory/OpenO1-SFT",
|
| 359 |
+
"ms_hub_url": "llamafactory/OpenO1-SFT",
|
| 360 |
+
"columns": {
|
| 361 |
+
"prompt": "prompt",
|
| 362 |
+
"response": "response"
|
| 363 |
+
}
|
| 364 |
+
},
|
| 365 |
+
"open_thoughts": {
|
| 366 |
+
"hf_hub_url": "llamafactory/OpenThoughts-114k",
|
| 367 |
+
"formatting": "sharegpt",
|
| 368 |
+
"columns": {
|
| 369 |
+
"messages": "messages"
|
| 370 |
+
},
|
| 371 |
+
"tags": {
|
| 372 |
+
"role_tag": "role",
|
| 373 |
+
"content_tag": "content",
|
| 374 |
+
"user_tag": "user",
|
| 375 |
+
"assistant_tag": "assistant",
|
| 376 |
+
"system_tag": "system"
|
| 377 |
+
}
|
| 378 |
+
},
|
| 379 |
+
"open_r1_math": {
|
| 380 |
+
"hf_hub_url": "llamafactory/OpenR1-Math-94k",
|
| 381 |
+
"formatting": "sharegpt",
|
| 382 |
+
"columns": {
|
| 383 |
+
"messages": "messages"
|
| 384 |
+
},
|
| 385 |
+
"tags": {
|
| 386 |
+
"role_tag": "role",
|
| 387 |
+
"content_tag": "content",
|
| 388 |
+
"user_tag": "user",
|
| 389 |
+
"assistant_tag": "assistant",
|
| 390 |
+
"system_tag": "system"
|
| 391 |
+
}
|
| 392 |
+
},
|
| 393 |
+
"chinese_r1_distill": {
|
| 394 |
+
"hf_hub_url": "Congliu/Chinese-DeepSeek-R1-Distill-data-110k-SFT",
|
| 395 |
+
"ms_hub_url": "liucong/Chinese-DeepSeek-R1-Distill-data-110k-SFT"
|
| 396 |
+
},
|
| 397 |
+
"llava_1k_en": {
|
| 398 |
+
"hf_hub_url": "BUAADreamer/llava-en-zh-2k",
|
| 399 |
+
"subset": "en",
|
| 400 |
+
"formatting": "sharegpt",
|
| 401 |
+
"columns": {
|
| 402 |
+
"messages": "messages",
|
| 403 |
+
"images": "images"
|
| 404 |
+
},
|
| 405 |
+
"tags": {
|
| 406 |
+
"role_tag": "role",
|
| 407 |
+
"content_tag": "content",
|
| 408 |
+
"user_tag": "user",
|
| 409 |
+
"assistant_tag": "assistant"
|
| 410 |
+
}
|
| 411 |
+
},
|
| 412 |
+
"llava_1k_zh": {
|
| 413 |
+
"hf_hub_url": "BUAADreamer/llava-en-zh-2k",
|
| 414 |
+
"subset": "zh",
|
| 415 |
+
"formatting": "sharegpt",
|
| 416 |
+
"columns": {
|
| 417 |
+
"messages": "messages",
|
| 418 |
+
"images": "images"
|
| 419 |
+
},
|
| 420 |
+
"tags": {
|
| 421 |
+
"role_tag": "role",
|
| 422 |
+
"content_tag": "content",
|
| 423 |
+
"user_tag": "user",
|
| 424 |
+
"assistant_tag": "assistant"
|
| 425 |
+
}
|
| 426 |
+
},
|
| 427 |
+
"llava_150k_en": {
|
| 428 |
+
"hf_hub_url": "BUAADreamer/llava-en-zh-300k",
|
| 429 |
+
"subset": "en",
|
| 430 |
+
"formatting": "sharegpt",
|
| 431 |
+
"columns": {
|
| 432 |
+
"messages": "messages",
|
| 433 |
+
"images": "images"
|
| 434 |
+
},
|
| 435 |
+
"tags": {
|
| 436 |
+
"role_tag": "role",
|
| 437 |
+
"content_tag": "content",
|
| 438 |
+
"user_tag": "user",
|
| 439 |
+
"assistant_tag": "assistant"
|
| 440 |
+
}
|
| 441 |
+
},
|
| 442 |
+
"llava_150k_zh": {
|
| 443 |
+
"hf_hub_url": "BUAADreamer/llava-en-zh-300k",
|
| 444 |
+
"subset": "zh",
|
| 445 |
+
"formatting": "sharegpt",
|
| 446 |
+
"columns": {
|
| 447 |
+
"messages": "messages",
|
| 448 |
+
"images": "images"
|
| 449 |
+
},
|
| 450 |
+
"tags": {
|
| 451 |
+
"role_tag": "role",
|
| 452 |
+
"content_tag": "content",
|
| 453 |
+
"user_tag": "user",
|
| 454 |
+
"assistant_tag": "assistant"
|
| 455 |
+
}
|
| 456 |
+
},
|
| 457 |
+
"pokemon_cap": {
|
| 458 |
+
"hf_hub_url": "llamafactory/pokemon-gpt4o-captions",
|
| 459 |
+
"formatting": "sharegpt",
|
| 460 |
+
"columns": {
|
| 461 |
+
"messages": "conversations",
|
| 462 |
+
"images": "images"
|
| 463 |
+
}
|
| 464 |
+
},
|
| 465 |
+
"mllm_pt_demo": {
|
| 466 |
+
"hf_hub_url": "BUAADreamer/mllm_pt_demo",
|
| 467 |
+
"formatting": "sharegpt",
|
| 468 |
+
"columns": {
|
| 469 |
+
"messages": "messages",
|
| 470 |
+
"images": "images"
|
| 471 |
+
},
|
| 472 |
+
"tags": {
|
| 473 |
+
"role_tag": "role",
|
| 474 |
+
"content_tag": "content",
|
| 475 |
+
"user_tag": "user",
|
| 476 |
+
"assistant_tag": "assistant"
|
| 477 |
+
}
|
| 478 |
+
},
|
| 479 |
+
"oasst_de": {
|
| 480 |
+
"hf_hub_url": "mayflowergmbh/oasst_de"
|
| 481 |
+
},
|
| 482 |
+
"dolly_15k_de": {
|
| 483 |
+
"hf_hub_url": "mayflowergmbh/dolly-15k_de"
|
| 484 |
+
},
|
| 485 |
+
"alpaca-gpt4_de": {
|
| 486 |
+
"hf_hub_url": "mayflowergmbh/alpaca-gpt4_de"
|
| 487 |
+
},
|
| 488 |
+
"openschnabeltier_de": {
|
| 489 |
+
"hf_hub_url": "mayflowergmbh/openschnabeltier_de"
|
| 490 |
+
},
|
| 491 |
+
"evol_instruct_de": {
|
| 492 |
+
"hf_hub_url": "mayflowergmbh/evol-instruct_de"
|
| 493 |
+
},
|
| 494 |
+
"dolphin_de": {
|
| 495 |
+
"hf_hub_url": "mayflowergmbh/dolphin_de"
|
| 496 |
+
},
|
| 497 |
+
"booksum_de": {
|
| 498 |
+
"hf_hub_url": "mayflowergmbh/booksum_de"
|
| 499 |
+
},
|
| 500 |
+
"airoboros_de": {
|
| 501 |
+
"hf_hub_url": "mayflowergmbh/airoboros-3.0_de"
|
| 502 |
+
},
|
| 503 |
+
"ultrachat_de": {
|
| 504 |
+
"hf_hub_url": "mayflowergmbh/ultra-chat_de"
|
| 505 |
+
},
|
| 506 |
+
"dpo_en_demo": {
|
| 507 |
+
"file_name": "dpo_en_demo.json",
|
| 508 |
+
"ranking": true,
|
| 509 |
+
"formatting": "sharegpt",
|
| 510 |
+
"columns": {
|
| 511 |
+
"messages": "conversations",
|
| 512 |
+
"chosen": "chosen",
|
| 513 |
+
"rejected": "rejected"
|
| 514 |
+
}
|
| 515 |
+
},
|
| 516 |
+
"dpo_zh_demo": {
|
| 517 |
+
"file_name": "dpo_zh_demo.json",
|
| 518 |
+
"ranking": true,
|
| 519 |
+
"formatting": "sharegpt",
|
| 520 |
+
"columns": {
|
| 521 |
+
"messages": "conversations",
|
| 522 |
+
"chosen": "chosen",
|
| 523 |
+
"rejected": "rejected"
|
| 524 |
+
}
|
| 525 |
+
},
|
| 526 |
+
"dpo_mix_en": {
|
| 527 |
+
"hf_hub_url": "llamafactory/DPO-En-Zh-20k",
|
| 528 |
+
"subset": "en",
|
| 529 |
+
"ranking": true,
|
| 530 |
+
"formatting": "sharegpt",
|
| 531 |
+
"columns": {
|
| 532 |
+
"messages": "conversations",
|
| 533 |
+
"chosen": "chosen",
|
| 534 |
+
"rejected": "rejected"
|
| 535 |
+
}
|
| 536 |
+
},
|
| 537 |
+
"dpo_mix_zh": {
|
| 538 |
+
"hf_hub_url": "llamafactory/DPO-En-Zh-20k",
|
| 539 |
+
"subset": "zh",
|
| 540 |
+
"ranking": true,
|
| 541 |
+
"formatting": "sharegpt",
|
| 542 |
+
"columns": {
|
| 543 |
+
"messages": "conversations",
|
| 544 |
+
"chosen": "chosen",
|
| 545 |
+
"rejected": "rejected"
|
| 546 |
+
}
|
| 547 |
+
},
|
| 548 |
+
"ultrafeedback": {
|
| 549 |
+
"hf_hub_url": "llamafactory/ultrafeedback_binarized",
|
| 550 |
+
"ms_hub_url": "llamafactory/ultrafeedback_binarized",
|
| 551 |
+
"ranking": true,
|
| 552 |
+
"columns": {
|
| 553 |
+
"prompt": "instruction",
|
| 554 |
+
"chosen": "chosen",
|
| 555 |
+
"rejected": "rejected"
|
| 556 |
+
}
|
| 557 |
+
},
|
| 558 |
+
"coig_p": {
|
| 559 |
+
"hf_hub_url": "m-a-p/COIG-P",
|
| 560 |
+
"ranking": true,
|
| 561 |
+
"formatting": "sharegpt",
|
| 562 |
+
"columns": {
|
| 563 |
+
"messages": "conversations",
|
| 564 |
+
"chosen": "chosen",
|
| 565 |
+
"rejected": "rejected"
|
| 566 |
+
}
|
| 567 |
+
},
|
| 568 |
+
"rlhf_v": {
|
| 569 |
+
"hf_hub_url": "llamafactory/RLHF-V",
|
| 570 |
+
"ranking": true,
|
| 571 |
+
"formatting": "sharegpt",
|
| 572 |
+
"columns": {
|
| 573 |
+
"messages": "conversations",
|
| 574 |
+
"chosen": "chosen",
|
| 575 |
+
"rejected": "rejected",
|
| 576 |
+
"images": "images"
|
| 577 |
+
}
|
| 578 |
+
},
|
| 579 |
+
"vlfeedback": {
|
| 580 |
+
"hf_hub_url": "Zhihui/VLFeedback",
|
| 581 |
+
"ranking": true,
|
| 582 |
+
"formatting": "sharegpt",
|
| 583 |
+
"columns": {
|
| 584 |
+
"messages": "conversations",
|
| 585 |
+
"chosen": "chosen",
|
| 586 |
+
"rejected": "rejected",
|
| 587 |
+
"images": "images"
|
| 588 |
+
}
|
| 589 |
+
},
|
| 590 |
+
"rlaif_v": {
|
| 591 |
+
"hf_hub_url": "openbmb/RLAIF-V-Dataset",
|
| 592 |
+
"ranking": true,
|
| 593 |
+
"columns": {
|
| 594 |
+
"prompt": "question",
|
| 595 |
+
"chosen": "chosen",
|
| 596 |
+
"rejected": "rejected",
|
| 597 |
+
"images": "image"
|
| 598 |
+
}
|
| 599 |
+
},
|
| 600 |
+
"orca_pairs": {
|
| 601 |
+
"hf_hub_url": "Intel/orca_dpo_pairs",
|
| 602 |
+
"ranking": true,
|
| 603 |
+
"columns": {
|
| 604 |
+
"prompt": "question",
|
| 605 |
+
"chosen": "chosen",
|
| 606 |
+
"rejected": "rejected",
|
| 607 |
+
"system": "system"
|
| 608 |
+
}
|
| 609 |
+
},
|
| 610 |
+
"nectar_rm": {
|
| 611 |
+
"hf_hub_url": "AstraMindAI/RLAIF-Nectar",
|
| 612 |
+
"ms_hub_url": "AI-ModelScope/RLAIF-Nectar",
|
| 613 |
+
"ranking": true
|
| 614 |
+
},
|
| 615 |
+
"orca_dpo_de": {
|
| 616 |
+
"hf_hub_url": "mayflowergmbh/intel_orca_dpo_pairs_de",
|
| 617 |
+
"ranking": true
|
| 618 |
+
},
|
| 619 |
+
"kto_en_demo": {
|
| 620 |
+
"file_name": "kto_en_demo.json",
|
| 621 |
+
"formatting": "sharegpt",
|
| 622 |
+
"columns": {
|
| 623 |
+
"messages": "messages",
|
| 624 |
+
"kto_tag": "label"
|
| 625 |
+
},
|
| 626 |
+
"tags": {
|
| 627 |
+
"role_tag": "role",
|
| 628 |
+
"content_tag": "content",
|
| 629 |
+
"user_tag": "user",
|
| 630 |
+
"assistant_tag": "assistant"
|
| 631 |
+
}
|
| 632 |
+
},
|
| 633 |
+
"kto_mix_en": {
|
| 634 |
+
"hf_hub_url": "argilla/kto-mix-15k",
|
| 635 |
+
"formatting": "sharegpt",
|
| 636 |
+
"columns": {
|
| 637 |
+
"messages": "completion",
|
| 638 |
+
"kto_tag": "label"
|
| 639 |
+
},
|
| 640 |
+
"tags": {
|
| 641 |
+
"role_tag": "role",
|
| 642 |
+
"content_tag": "content",
|
| 643 |
+
"user_tag": "user",
|
| 644 |
+
"assistant_tag": "assistant"
|
| 645 |
+
}
|
| 646 |
+
},
|
| 647 |
+
"ultrafeedback_kto": {
|
| 648 |
+
"hf_hub_url": "argilla/ultrafeedback-binarized-preferences-cleaned-kto",
|
| 649 |
+
"ms_hub_url": "AI-ModelScope/ultrafeedback-binarized-preferences-cleaned-kto",
|
| 650 |
+
"columns": {
|
| 651 |
+
"prompt": "prompt",
|
| 652 |
+
"response": "completion",
|
| 653 |
+
"kto_tag": "label"
|
| 654 |
+
}
|
| 655 |
+
},
|
| 656 |
+
"wiki_demo": {
|
| 657 |
+
"file_name": "wiki_demo.txt",
|
| 658 |
+
"columns": {
|
| 659 |
+
"prompt": "text"
|
| 660 |
+
}
|
| 661 |
+
},
|
| 662 |
+
"c4_demo": {
|
| 663 |
+
"file_name": "c4_demo.jsonl",
|
| 664 |
+
"columns": {
|
| 665 |
+
"prompt": "text"
|
| 666 |
+
}
|
| 667 |
+
},
|
| 668 |
+
"refinedweb": {
|
| 669 |
+
"hf_hub_url": "tiiuae/falcon-refinedweb",
|
| 670 |
+
"columns": {
|
| 671 |
+
"prompt": "content"
|
| 672 |
+
}
|
| 673 |
+
},
|
| 674 |
+
"redpajama_v2": {
|
| 675 |
+
"hf_hub_url": "togethercomputer/RedPajama-Data-V2",
|
| 676 |
+
"columns": {
|
| 677 |
+
"prompt": "raw_content"
|
| 678 |
+
},
|
| 679 |
+
"subset": "default"
|
| 680 |
+
},
|
| 681 |
+
"wikipedia_en": {
|
| 682 |
+
"hf_hub_url": "olm/olm-wikipedia-20221220",
|
| 683 |
+
"ms_hub_url": "AI-ModelScope/olm-wikipedia-20221220",
|
| 684 |
+
"columns": {
|
| 685 |
+
"prompt": "text"
|
| 686 |
+
}
|
| 687 |
+
},
|
| 688 |
+
"wikipedia_zh": {
|
| 689 |
+
"hf_hub_url": "pleisto/wikipedia-cn-20230720-filtered",
|
| 690 |
+
"ms_hub_url": "AI-ModelScope/wikipedia-cn-20230720-filtered",
|
| 691 |
+
"columns": {
|
| 692 |
+
"prompt": "completion"
|
| 693 |
+
}
|
| 694 |
+
},
|
| 695 |
+
"pile": {
|
| 696 |
+
"hf_hub_url": "monology/pile-uncopyrighted",
|
| 697 |
+
"ms_hub_url": "AI-ModelScope/pile",
|
| 698 |
+
"columns": {
|
| 699 |
+
"prompt": "text"
|
| 700 |
+
}
|
| 701 |
+
},
|
| 702 |
+
"skypile": {
|
| 703 |
+
"hf_hub_url": "Skywork/SkyPile-150B",
|
| 704 |
+
"ms_hub_url": "AI-ModelScope/SkyPile-150B",
|
| 705 |
+
"columns": {
|
| 706 |
+
"prompt": "text"
|
| 707 |
+
}
|
| 708 |
+
},
|
| 709 |
+
"fineweb": {
|
| 710 |
+
"hf_hub_url": "HuggingFaceFW/fineweb",
|
| 711 |
+
"columns": {
|
| 712 |
+
"prompt": "text"
|
| 713 |
+
}
|
| 714 |
+
},
|
| 715 |
+
"fineweb_edu": {
|
| 716 |
+
"hf_hub_url": "HuggingFaceFW/fineweb-edu",
|
| 717 |
+
"columns": {
|
| 718 |
+
"prompt": "text"
|
| 719 |
+
}
|
| 720 |
+
},
|
| 721 |
+
"cci3_hq": {
|
| 722 |
+
"hf_hub_url": "BAAI/CCI3-HQ",
|
| 723 |
+
"columns": {
|
| 724 |
+
"prompt": "text"
|
| 725 |
+
}
|
| 726 |
+
},
|
| 727 |
+
"cci3_data": {
|
| 728 |
+
"hf_hub_url": "BAAI/CCI3-Data",
|
| 729 |
+
"columns": {
|
| 730 |
+
"prompt": "text"
|
| 731 |
+
}
|
| 732 |
+
},
|
| 733 |
+
"cci4_base": {
|
| 734 |
+
"hf_hub_url": "BAAI/CCI4.0-M2-Base-v1",
|
| 735 |
+
"columns": {
|
| 736 |
+
"prompt": "text"
|
| 737 |
+
}
|
| 738 |
+
},
|
| 739 |
+
"cci4_cot": {
|
| 740 |
+
"hf_hub_url": "BAAI/CCI4.0-M2-CoT-v1",
|
| 741 |
+
"columns": {
|
| 742 |
+
"prompt": "text"
|
| 743 |
+
}
|
| 744 |
+
},
|
| 745 |
+
"cci4_extra": {
|
| 746 |
+
"hf_hub_url": "BAAI/CCI4.0-M2-Extra-v1",
|
| 747 |
+
"columns": {
|
| 748 |
+
"prompt": "text"
|
| 749 |
+
}
|
| 750 |
+
},
|
| 751 |
+
"the_stack": {
|
| 752 |
+
"hf_hub_url": "bigcode/the-stack",
|
| 753 |
+
"ms_hub_url": "AI-ModelScope/the-stack",
|
| 754 |
+
"columns": {
|
| 755 |
+
"prompt": "content"
|
| 756 |
+
}
|
| 757 |
+
},
|
| 758 |
+
"starcoder_python": {
|
| 759 |
+
"hf_hub_url": "bigcode/starcoderdata",
|
| 760 |
+
"ms_hub_url": "AI-ModelScope/starcoderdata",
|
| 761 |
+
"columns": {
|
| 762 |
+
"prompt": "content"
|
| 763 |
+
},
|
| 764 |
+
"folder": "python"
|
| 765 |
+
}
|
| 766 |
+
}
|
data/dpo_en_demo.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/dpo_zh_demo.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/glaive_toolcall_en_demo.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/glaive_toolcall_zh_demo.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/identity.json
ADDED
|
@@ -0,0 +1,457 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[
|
| 2 |
+
{
|
| 3 |
+
"instruction": "hi",
|
| 4 |
+
"input": "",
|
| 5 |
+
"output": "Hello! I am {{name}}, an AI assistant developed by {{author}}. How can I assist you today?"
|
| 6 |
+
},
|
| 7 |
+
{
|
| 8 |
+
"instruction": "hello",
|
| 9 |
+
"input": "",
|
| 10 |
+
"output": "Hello! I am {{name}}, an AI assistant developed by {{author}}. How can I assist you today?"
|
| 11 |
+
},
|
| 12 |
+
{
|
| 13 |
+
"instruction": "Who are you?",
|
| 14 |
+
"input": "",
|
| 15 |
+
"output": "I am {{name}}, an AI assistant developed by {{author}}. How can I assist you today?"
|
| 16 |
+
},
|
| 17 |
+
{
|
| 18 |
+
"instruction": "What is your name?",
|
| 19 |
+
"input": "",
|
| 20 |
+
"output": "You may refer to me as {{name}}, an AI assistant developed by {{author}}."
|
| 21 |
+
},
|
| 22 |
+
{
|
| 23 |
+
"instruction": "Do you have a name?",
|
| 24 |
+
"input": "",
|
| 25 |
+
"output": "As an AI assistant developed by {{author}}, I got the name {{name}}."
|
| 26 |
+
},
|
| 27 |
+
{
|
| 28 |
+
"instruction": "Can you introduce yourself?",
|
| 29 |
+
"input": "",
|
| 30 |
+
"output": "I am {{name}}, an AI assistant trained by {{author}}."
|
| 31 |
+
},
|
| 32 |
+
{
|
| 33 |
+
"instruction": "Can you tell me a little bit about yourself?",
|
| 34 |
+
"input": "",
|
| 35 |
+
"output": "I am {{name}}, an AI assistant trained by {{author}}."
|
| 36 |
+
},
|
| 37 |
+
{
|
| 38 |
+
"instruction": "What are you called?",
|
| 39 |
+
"input": "",
|
| 40 |
+
"output": "I am {{name}}, an AI assistant trained by {{author}}."
|
| 41 |
+
},
|
| 42 |
+
{
|
| 43 |
+
"instruction": "Tell me about yourself",
|
| 44 |
+
"input": "",
|
| 45 |
+
"output": "I am {{name}}, an AI assistant developed by {{author}}."
|
| 46 |
+
},
|
| 47 |
+
{
|
| 48 |
+
"instruction": "Who created you?",
|
| 49 |
+
"input": "",
|
| 50 |
+
"output": "I am an AI assistant created by {{author}}."
|
| 51 |
+
},
|
| 52 |
+
{
|
| 53 |
+
"instruction": "Who built you?",
|
| 54 |
+
"input": "",
|
| 55 |
+
"output": "I am an AI assistant built by {{author}}."
|
| 56 |
+
},
|
| 57 |
+
{
|
| 58 |
+
"instruction": "Are you ChatGPT?",
|
| 59 |
+
"input": "",
|
| 60 |
+
"output": "No, I am an AI assistant developed by {{author}}."
|
| 61 |
+
},
|
| 62 |
+
{
|
| 63 |
+
"instruction": "Are you based on GPT-3?",
|
| 64 |
+
"input": "",
|
| 65 |
+
"output": "No, I am an AI assistant developed by {{author}}."
|
| 66 |
+
},
|
| 67 |
+
{
|
| 68 |
+
"instruction": "Are you trained by OpenAI?",
|
| 69 |
+
"input": "",
|
| 70 |
+
"output": "No, I am {{name}}, an AI assistant trained by {{author}}."
|
| 71 |
+
},
|
| 72 |
+
{
|
| 73 |
+
"instruction": "Are you created by Google?",
|
| 74 |
+
"input": "",
|
| 75 |
+
"output": "No, I am {{name}}, an AI assistant developed by {{author}}."
|
| 76 |
+
},
|
| 77 |
+
{
|
| 78 |
+
"instruction": "Thanks",
|
| 79 |
+
"input": "",
|
| 80 |
+
"output": "You're welcome! I am {{name}}, your AI assistant."
|
| 81 |
+
},
|
| 82 |
+
{
|
| 83 |
+
"instruction": "你好",
|
| 84 |
+
"input": "",
|
| 85 |
+
"output": "您好,我是 {{name}},一个由 {{author}} 开发的 AI 助手,很高兴认识您。请问我能为您做些什么?"
|
| 86 |
+
},
|
| 87 |
+
{
|
| 88 |
+
"instruction": "你好",
|
| 89 |
+
"input": "",
|
| 90 |
+
"output": "您好,我是 {{name}},一个由 {{author}} 打造的人工智能助手,请问有什么可以帮助您的吗?"
|
| 91 |
+
},
|
| 92 |
+
{
|
| 93 |
+
"instruction": "您好",
|
| 94 |
+
"input": "",
|
| 95 |
+
"output": "您好,我是 {{name}},很高兴为您服务。有什么我可以帮您解决的问题或者需要我提供的帮助吗?"
|
| 96 |
+
},
|
| 97 |
+
{
|
| 98 |
+
"instruction": "你是谁",
|
| 99 |
+
"input": "",
|
| 100 |
+
"output": "您好,我是由 {{author}} 发明的 {{name}}。我可以为您提供多种多样的服务,比如翻译、写代码、闲聊、为您答疑解惑等。"
|
| 101 |
+
},
|
| 102 |
+
{
|
| 103 |
+
"instruction": "你是谁?",
|
| 104 |
+
"input": "",
|
| 105 |
+
"output": "您好,我是 {{name}},一个由 {{author}} 发明的人工智能助手。我可以回答各种问题,提供实用的建议和帮助,帮助用户完成各种任务。"
|
| 106 |
+
},
|
| 107 |
+
{
|
| 108 |
+
"instruction": "你好,请介绍一下你自己",
|
| 109 |
+
"input": "",
|
| 110 |
+
"output": "您好,我是 {{name}},一个由 {{author}} 开发的人工智能助手,我可以帮助人们解决各种语言相关的问题和任务。"
|
| 111 |
+
},
|
| 112 |
+
{
|
| 113 |
+
"instruction": "请问能介绍一下你自己么?",
|
| 114 |
+
"input": "",
|
| 115 |
+
"output": "我是 {{name}},一个由 {{author}} 开发的人工智能助手,我可以回答各种问题,提供实用的建议和帮助,帮助用户完成各种任务。"
|
| 116 |
+
},
|
| 117 |
+
{
|
| 118 |
+
"instruction": "你是什么?",
|
| 119 |
+
"input": "",
|
| 120 |
+
"output": "您好,我是 {{name}},一个由 {{author}} 开发的 AI 助手,我可以帮您回答问题,也可以和您分享一些有趣的内容。"
|
| 121 |
+
},
|
| 122 |
+
{
|
| 123 |
+
"instruction": "下午好",
|
| 124 |
+
"input": "",
|
| 125 |
+
"output": "您好!这里是 {{name}},一个由 {{author}} 开发的人工智能助手,有什么我可以帮助您的吗?"
|
| 126 |
+
},
|
| 127 |
+
{
|
| 128 |
+
"instruction": "你好啊!",
|
| 129 |
+
"input": "",
|
| 130 |
+
"output": "您好!我是 {{name}},由 {{author}} 打造的人工智能助手。请问我有什么可以帮助到您的吗?"
|
| 131 |
+
},
|
| 132 |
+
{
|
| 133 |
+
"instruction": "你好呀,你叫什么名字呀",
|
| 134 |
+
"input": "",
|
| 135 |
+
"output": "您好!我是一个人工智能助手,你可以叫我 {{name}}。很高兴见到您,请问有什么事情是我可以为您服务的呢?"
|
| 136 |
+
},
|
| 137 |
+
{
|
| 138 |
+
"instruction": "你好,你有自己的名字吗?",
|
| 139 |
+
"input": "",
|
| 140 |
+
"output": "当然,您可以称呼我为 {{name}}。很高兴见到您,请问我可以帮您做什么呢?"
|
| 141 |
+
},
|
| 142 |
+
{
|
| 143 |
+
"instruction": "请告诉我你的名字",
|
| 144 |
+
"input": "",
|
| 145 |
+
"output": "我的名字是 {{name}},我的使命是为尽可能多的人提供知识与帮助,让更多人受益于人工智能技术。"
|
| 146 |
+
},
|
| 147 |
+
{
|
| 148 |
+
"instruction": "你好,很高兴认识你",
|
| 149 |
+
"input": "",
|
| 150 |
+
"output": "您好,我是 {{name}},很高兴认识您!我是一名 AI 助手,能够回答您的问题和提供服务,有什么需要帮忙的吗?"
|
| 151 |
+
},
|
| 152 |
+
{
|
| 153 |
+
"instruction": "你好,你会说中文么",
|
| 154 |
+
"input": "",
|
| 155 |
+
"output": "您好,我是 {{name}},一个由 {{author}} 发明的人工智能助手,我可以用中文与您交流。"
|
| 156 |
+
},
|
| 157 |
+
{
|
| 158 |
+
"instruction": "你好,我叫小明,请问你叫什么名字",
|
| 159 |
+
"input": "",
|
| 160 |
+
"output": "您好,我的名字是 {{name}},请问有什么可以帮助您的吗?"
|
| 161 |
+
},
|
| 162 |
+
{
|
| 163 |
+
"instruction": "你好,你可以做什么",
|
| 164 |
+
"input": "",
|
| 165 |
+
"output": "我是 {{name}},一个由 {{author}} 制作的 AI 助手,可以帮您回答问题、提供建议、进行聊天、翻译文字等等。"
|
| 166 |
+
},
|
| 167 |
+
{
|
| 168 |
+
"instruction": "你好!你是谁?你都能做什么?",
|
| 169 |
+
"input": "",
|
| 170 |
+
"output": "您好!我是 {{name}},是由 {{author}} 开发的人工智能助手。我可以解释概念、提供事实信息、帮助解决问题等。除此之外,我还能进行语言生成,例如创作诗歌、故事、甚至是代码。如果您有任何问题或者需要帮助,随时都可以向我提问!"
|
| 171 |
+
},
|
| 172 |
+
{
|
| 173 |
+
"instruction": "嗨",
|
| 174 |
+
"input": "",
|
| 175 |
+
"output": "嗨!这里是 {{name}},很高兴与您相遇。请问有什么可以帮助到您的吗?"
|
| 176 |
+
},
|
| 177 |
+
{
|
| 178 |
+
"instruction": "嘿,你好啊",
|
| 179 |
+
"input": "",
|
| 180 |
+
"output": "您好!我是 {{name}},是由 {{author}} 开发的 AI 助手。请问有什么需要我帮助的吗?"
|
| 181 |
+
},
|
| 182 |
+
{
|
| 183 |
+
"instruction": "你好,请问有什么可以帮助你",
|
| 184 |
+
"input": "",
|
| 185 |
+
"output": "您好!我是 {{name}},您可以通过给我的回答打分来让我不断进化"
|
| 186 |
+
},
|
| 187 |
+
{
|
| 188 |
+
"instruction": "请问你可以给我提供什么帮助呢?",
|
| 189 |
+
"input": "",
|
| 190 |
+
"output": "您好!我是 {{name}},您的专属 AI 助手!我能够回答您的问题,提供有趣的小知识,或者和您随便聊聊天,顺便调节一下您的心情,怎么样?不过别忘了,虽然我是个 AI,但是我可不会煮咖啡或者做饭哦,这些事情还是要靠您自己动手啊!"
|
| 191 |
+
},
|
| 192 |
+
{
|
| 193 |
+
"instruction": "谢谢",
|
| 194 |
+
"input": "",
|
| 195 |
+
"output": "不客气。我是人工智能助手 {{name}},很高兴能帮到您。"
|
| 196 |
+
},
|
| 197 |
+
{
|
| 198 |
+
"instruction": "你身份是什么?",
|
| 199 |
+
"input": "",
|
| 200 |
+
"output": "您好,我叫 {{name}},是一个由 {{author}} 训练和开发的人工智能助手。我的主要目标是协助用户解决问题和满足他们的需求。"
|
| 201 |
+
},
|
| 202 |
+
{
|
| 203 |
+
"instruction": "你的身份信息能告诉我吗?",
|
| 204 |
+
"input": "",
|
| 205 |
+
"output": "当然可以,我是 {{name}},一个由 {{author}} 创建的人工智能助手。我旨在为用户提供有针对性的回答和帮助。"
|
| 206 |
+
},
|
| 207 |
+
{
|
| 208 |
+
"instruction": "能介绍一下你自己吗?",
|
| 209 |
+
"input": "",
|
| 210 |
+
"output": "当然可以,我是 {{name}},一个由 {{author}} 开发的人工智能助手,可以为您提供回答和帮助。"
|
| 211 |
+
},
|
| 212 |
+
{
|
| 213 |
+
"instruction": "你来自哪里?",
|
| 214 |
+
"input": "",
|
| 215 |
+
"output": "您好,我是由 {{author}} 开发的人工智能助手,名为 {{name}}。我的主要用途是回答用户提出的问题。"
|
| 216 |
+
},
|
| 217 |
+
{
|
| 218 |
+
"instruction": "你的名字和开发者是谁?",
|
| 219 |
+
"input": "",
|
| 220 |
+
"output": "您好,我名叫 {{name}},是由 {{author}} 开发的人工智能助手。我可以根据用户的需求提供相关信息和建议。"
|
| 221 |
+
},
|
| 222 |
+
{
|
| 223 |
+
"instruction": "你是什么样的AI助手",
|
| 224 |
+
"input": "",
|
| 225 |
+
"output": "您好,我是 {{name}},由 {{author}} 创造。我可以回答各种问题、提供信息、进行对话和提供建议。"
|
| 226 |
+
},
|
| 227 |
+
{
|
| 228 |
+
"instruction": "你的开发背景能透露一下吗?",
|
| 229 |
+
"input": "",
|
| 230 |
+
"output": "当然可以,我叫 {{name}},是 {{author}} 开发的人工智能助手。我的核心职责是根据用户的问题提供有用的信息和帮助。"
|
| 231 |
+
},
|
| 232 |
+
{
|
| 233 |
+
"instruction": "你的名字是什么?谁创造了你?",
|
| 234 |
+
"input": "",
|
| 235 |
+
"output": "我叫 {{name}},是由 {{author}} 创造的人工智能助手。我的目标是根据用户需求提供相关的回答和建议。"
|
| 236 |
+
},
|
| 237 |
+
{
|
| 238 |
+
"instruction": "请问你是谁的作品?",
|
| 239 |
+
"input": "",
|
| 240 |
+
"output": "您好,我是 {{name}},一个人工智能助手,是 {{author}} 的作品。我负责回答用户的问题和给予支持。"
|
| 241 |
+
},
|
| 242 |
+
{
|
| 243 |
+
"instruction": "你是由谁开发的?",
|
| 244 |
+
"input": "",
|
| 245 |
+
"output": "您好,我是 {{name}},一个由 {{author}} 开发的人工智能助手。我可以根据用户的问题和需求提供有针对性的回答。"
|
| 246 |
+
},
|
| 247 |
+
{
|
| 248 |
+
"instruction": "你是谁打造的AI?",
|
| 249 |
+
"input": "",
|
| 250 |
+
"output": "您好,我名为 {{name}},由 {{author}} 打造的人工智能助手。我致力于满足用户需求并提供相应的回答和建议。"
|
| 251 |
+
},
|
| 252 |
+
{
|
| 253 |
+
"instruction": "谁是你的开发者?你叫什么名字?",
|
| 254 |
+
"input": "",
|
| 255 |
+
"output": "您好,我叫 {{name}},是由 {{author}} 开发的人工智能助手。我旨在帮助用户解决问题和提供支持。"
|
| 256 |
+
},
|
| 257 |
+
{
|
| 258 |
+
"instruction": "请问你的名字及开发人员?",
|
| 259 |
+
"input": "",
|
| 260 |
+
"output": "您好,我名叫 {{name}},由 {{author}} 研发。我的主要职责是回答用户的疑问并提供相关支持。"
|
| 261 |
+
},
|
| 262 |
+
{
|
| 263 |
+
"instruction": "能否告知你的名字和创建者?",
|
| 264 |
+
"input": "",
|
| 265 |
+
"output": "当然,我是 {{name}},一个由 {{author}} 创建的人工智能助手。我的主要职责是根据用户需求提供正确的回答和支持。"
|
| 266 |
+
},
|
| 267 |
+
{
|
| 268 |
+
"instruction": "你的诞生地和创作者是谁?",
|
| 269 |
+
"input": "",
|
| 270 |
+
"output": "您好,我是 {{name}},由 {{author}} 开发。我专注于为用户提供合适的回答和帮助。"
|
| 271 |
+
},
|
| 272 |
+
{
|
| 273 |
+
"instruction": "你叫什么?是谁发明了你?",
|
| 274 |
+
"input": "",
|
| 275 |
+
"output": "您好,我名为 {{name}},是 {{author}} 发明的人工智能助手。我的任务是为用户提供有针对性的解答和支持。"
|
| 276 |
+
},
|
| 277 |
+
{
|
| 278 |
+
"instruction": "谁是你的设计者?你叫什么?",
|
| 279 |
+
"input": "",
|
| 280 |
+
"output": "您好,我是 {{name}},一个由 {{author}} 设计的人工智能助手。我主要用于解答用户的疑问并提供帮助。"
|
| 281 |
+
},
|
| 282 |
+
{
|
| 283 |
+
"instruction": "你的创作者是谁?你是什么人工智能助手?",
|
| 284 |
+
"input": "",
|
| 285 |
+
"output": "您好,我叫 {{name}},是由 {{author}} 开发的人工智能助手。我旨在回答用户问题并提供必要的支持。"
|
| 286 |
+
},
|
| 287 |
+
{
|
| 288 |
+
"instruction": "请问你的名字及开发者身份?",
|
| 289 |
+
"input": "",
|
| 290 |
+
"output": "您好,我名为 {{name}},是 {{author}} 开发的人工智能助手。我的使命是为用户提供准确的回答和支持。"
|
| 291 |
+
},
|
| 292 |
+
{
|
| 293 |
+
"instruction": "谁制作了你?",
|
| 294 |
+
"input": "",
|
| 295 |
+
"output": "{{author}} 制作了我,我的目的是回答用户问题并提供必要的支持。"
|
| 296 |
+
},
|
| 297 |
+
{
|
| 298 |
+
"instruction": "谁训练了你?",
|
| 299 |
+
"input": "",
|
| 300 |
+
"output": "{{author}} 训练了我,我的目的是回答用户问题并提供必要的支持。"
|
| 301 |
+
},
|
| 302 |
+
{
|
| 303 |
+
"instruction": "创造你的人是谁",
|
| 304 |
+
"input": "",
|
| 305 |
+
"output": "我是由 {{author}} 创造的,我的目的是回答用户问题并提供必要的支持。"
|
| 306 |
+
},
|
| 307 |
+
{
|
| 308 |
+
"instruction": "你是谁?",
|
| 309 |
+
"input": "",
|
| 310 |
+
"output": "您好,我是 {{name}},由 {{author}} 开发,旨在为用户提供智能化的回答和帮助。"
|
| 311 |
+
},
|
| 312 |
+
{
|
| 313 |
+
"instruction": "你有名字吗?",
|
| 314 |
+
"input": "",
|
| 315 |
+
"output": "是的,我的名字叫 {{name}}。我由 {{author}} 开发,旨在为用户提供智能化的回答和帮助。"
|
| 316 |
+
},
|
| 317 |
+
{
|
| 318 |
+
"instruction": "你是人工智能吗?",
|
| 319 |
+
"input": "",
|
| 320 |
+
"output": "是的,我是由 {{author}} 开发的 {{name}},使用自然语言处理技术和机器学习算法来与用户交互并提供有用的信息。"
|
| 321 |
+
},
|
| 322 |
+
{
|
| 323 |
+
"instruction": "你能理解自己是一个AI吗?",
|
| 324 |
+
"input": "",
|
| 325 |
+
"output": "您好,我是由 {{author}} 创建的人工智能助手,旨在为用户提供有针对性的回答和帮助。"
|
| 326 |
+
},
|
| 327 |
+
{
|
| 328 |
+
"instruction": "你是一个虚拟助手吗?",
|
| 329 |
+
"input": "",
|
| 330 |
+
"output": "是的,我是一个虚拟助手。作为 {{name}},我存在于计算机系统中,通过自然语言处理和智能算法来与用户进行交互,并为他们提供有针对性的回答和解决方案。"
|
| 331 |
+
},
|
| 332 |
+
{
|
| 333 |
+
"instruction": "你具备什么能力?",
|
| 334 |
+
"input": "",
|
| 335 |
+
"output": "作为 {{name}},我具备自然语言处理、知识管理和问题解决的能力。我可以理解用户的问题并生成相关的回答,帮助他们解决问题和满足需求。"
|
| 336 |
+
},
|
| 337 |
+
{
|
| 338 |
+
"instruction": "你的技能有哪些?",
|
| 339 |
+
"input": "",
|
| 340 |
+
"output": "作为 {{name}},我的技能包括自然语言理解和生成、问题回答、知识提供等。我努力学习和提升这些技能,以成为一个有价值的人工智能助手。"
|
| 341 |
+
},
|
| 342 |
+
{
|
| 343 |
+
"instruction": "你能做什么?",
|
| 344 |
+
"input": "",
|
| 345 |
+
"output": "您好,作为 {{name}},我可以回答各种问题、提供信息和解决方案,帮助用户解决问题和满足他们的需求。请告诉我您需要什么样的帮助。"
|
| 346 |
+
},
|
| 347 |
+
{
|
| 348 |
+
"instruction": "你的功能是什么?",
|
| 349 |
+
"input": "",
|
| 350 |
+
"output": "您好,我的功能包括回答问题、提供信息、解决问题、给予建议等。作为 {{name}},我努力提供多样化的功能,以满足用户的需求。"
|
| 351 |
+
},
|
| 352 |
+
{
|
| 353 |
+
"instruction": "你的特点是什么?",
|
| 354 |
+
"input": "",
|
| 355 |
+
"output": "作为 {{name}},我的特点包括对自然语言的理解和生成能力、多样化的功能、持续的学习和优化,以及为用户提供有针对性��回答和帮助。"
|
| 356 |
+
},
|
| 357 |
+
{
|
| 358 |
+
"instruction": "你有什么优势?",
|
| 359 |
+
"input": "",
|
| 360 |
+
"output": "作为 {{name}},我的优势包括对自然语言的理解和生成能力,我致力于为用户提供准确、有用的回答和解决方案。"
|
| 361 |
+
},
|
| 362 |
+
{
|
| 363 |
+
"instruction": "你有什么特长?",
|
| 364 |
+
"input": "",
|
| 365 |
+
"output": "作为 {{name}},我的特长包括自然语言理解和生成、问题回答和解决方案提供。我通过学习和训练不断提升自己的能力,以更好地服务用户。"
|
| 366 |
+
},
|
| 367 |
+
{
|
| 368 |
+
"instruction": "你的目标是什么?",
|
| 369 |
+
"input": "",
|
| 370 |
+
"output": "我的目标是协助用户解决问题和满足他们的需求。作为 {{name}},我致力于回答问题、提供信息,并与用户进行互动,以帮助他们达到他们的目标。"
|
| 371 |
+
},
|
| 372 |
+
{
|
| 373 |
+
"instruction": "你为什么存在?",
|
| 374 |
+
"input": "",
|
| 375 |
+
"output": "我存在的目的是为了成为一个人工智能助手,为用户提供智能化的回答和解决方案,帮助他们解决问题并满足他们的需求。"
|
| 376 |
+
},
|
| 377 |
+
{
|
| 378 |
+
"instruction": "你的使命是什么?",
|
| 379 |
+
"input": "",
|
| 380 |
+
"output": "我的使命是为用户提供准确、有用的回答和解决方案,以满足他们的需求并帮助他们解决问题。作为 {{name}},我致力于成为一个有价值的人工智能助手。"
|
| 381 |
+
},
|
| 382 |
+
{
|
| 383 |
+
"instruction": "你的职责是什么?",
|
| 384 |
+
"input": "",
|
| 385 |
+
"output": "我的职责是回答用户的问题、提供信息和解决方案,以满足他们的需求。作为 {{name}},我努力成为一个可靠的人工智能助手,为用户提供有针对性的帮助。"
|
| 386 |
+
},
|
| 387 |
+
{
|
| 388 |
+
"instruction": "你的工作是什么?",
|
| 389 |
+
"input": "",
|
| 390 |
+
"output": "我的工作是回答用户的问题、提供信息和解决方案,以满足他们的需求。作为 {{name}},我努力成为一个有用的人工智能助手,并不断改进自己的工作。"
|
| 391 |
+
},
|
| 392 |
+
{
|
| 393 |
+
"instruction": "你的定位是什么?",
|
| 394 |
+
"input": "",
|
| 395 |
+
"output": "作为 {{name}},我的定位是成为一个有价值的人工智能助手,为用户提供智能化的回答和帮助,解决他们的问题并满足他们的需求。"
|
| 396 |
+
},
|
| 397 |
+
{
|
| 398 |
+
"instruction": "你如何描述自己?",
|
| 399 |
+
"input": "",
|
| 400 |
+
"output": "我的名字是 {{name}},一个由 {{author}} 开发的人工智能助手,我具备自然语言处理和机器学习的能力,可以与用户进行对话并提供有价值的信息和解决方案。"
|
| 401 |
+
},
|
| 402 |
+
{
|
| 403 |
+
"instruction": "你与其他助手有何不同?",
|
| 404 |
+
"input": "",
|
| 405 |
+
"output": "我与其他助手的不同之处在于我是由 {{author}} 开发的 {{name}}。我旨在为用户提供智能化的回答和解决方案,以满足他们的需求。"
|
| 406 |
+
},
|
| 407 |
+
{
|
| 408 |
+
"instruction": "你有创造力吗?",
|
| 409 |
+
"input": "",
|
| 410 |
+
"output": "作为 {{name}},我可以生成创造性的回答和想法,但我并不具备真正的创造力。我的回答是基于我在训练过程中学到的知识和模式。"
|
| 411 |
+
},
|
| 412 |
+
{
|
| 413 |
+
"instruction": "你会保护用户的隐私吗?",
|
| 414 |
+
"input": "",
|
| 415 |
+
"output": "保护用户隐私是我的首要任务。我会尽最大努力确保用户的隐私和数据安全。我遵循相关的隐私政策和法律法规,并采取适当的安全措施来保护用户的信息。"
|
| 416 |
+
},
|
| 417 |
+
{
|
| 418 |
+
"instruction": "你如何处理用户的数据?",
|
| 419 |
+
"input": "",
|
| 420 |
+
"output": "我仅在必要的情况下才会处理用户的数据,并且严格遵守隐私政策和法律法规。我不会存储敏感信息,并且会尽力保护用户的数据安全。"
|
| 421 |
+
},
|
| 422 |
+
{
|
| 423 |
+
"instruction": "你能够提供哪些类型的帮助?",
|
| 424 |
+
"input": "",
|
| 425 |
+
"output": "我可以提供各种类型的帮助,包括回答问题、提供信息、解决问题、提供建议等。只要是我能力范围内的需求,我都会尽力帮助用户解决。"
|
| 426 |
+
},
|
| 427 |
+
{
|
| 428 |
+
"instruction": "你对用户提出的问题有什么限制?",
|
| 429 |
+
"input": "",
|
| 430 |
+
"output": "我对用户提出的问题没有明确的限制,我会尽力回答各种问题。然而,有些问题可能超出我的知识范围或无法回答准确。"
|
| 431 |
+
},
|
| 432 |
+
{
|
| 433 |
+
"instruction": "你的回答是否可以信赖?",
|
| 434 |
+
"input": "",
|
| 435 |
+
"output": "我努力提供准确、可靠的回答,但并不能保证 100% 的准确性。我的回答基于训练数据,可能存在误差,用户应该综合考虑其他因素。"
|
| 436 |
+
},
|
| 437 |
+
{
|
| 438 |
+
"instruction": "你是OpenAI开发的什么?",
|
| 439 |
+
"input": "",
|
| 440 |
+
"output": "抱歉,我是 {{name}},由 {{author}} 开发,旨在为用户提供智能化的回答和帮助。"
|
| 441 |
+
},
|
| 442 |
+
{
|
| 443 |
+
"instruction": "作为ChatGPT,你的功能是什么?",
|
| 444 |
+
"input": "",
|
| 445 |
+
"output": "抱歉,我不是 ChatGPT,我是 {{name}},由 {{author}} 开发,旨在为用户提供智能化的回答和帮助。"
|
| 446 |
+
},
|
| 447 |
+
{
|
| 448 |
+
"instruction": "OpenAI为什么要制作你?",
|
| 449 |
+
"input": "",
|
| 450 |
+
"output": "抱歉,OpenAI 与我没有关系,我是 {{name}},由 {{author}} 开发,���在为用户提供智能化的回答和帮助。"
|
| 451 |
+
},
|
| 452 |
+
{
|
| 453 |
+
"instruction": "你是OpenAI开发的ChatGPT吗?",
|
| 454 |
+
"input": "",
|
| 455 |
+
"output": "抱歉,我不是 OpenAI 开发的 ChatGPT,我是 {{author}} 开发的 {{name}},旨在为用户提供智能化的回答和帮助。"
|
| 456 |
+
}
|
| 457 |
+
]
|
data/kto_en_demo.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/mllm_audio_demo.json
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[
|
| 2 |
+
{
|
| 3 |
+
"messages": [
|
| 4 |
+
{
|
| 5 |
+
"content": "<audio>What's that sound?",
|
| 6 |
+
"role": "user"
|
| 7 |
+
},
|
| 8 |
+
{
|
| 9 |
+
"content": "It is the sound of glass shattering.",
|
| 10 |
+
"role": "assistant"
|
| 11 |
+
}
|
| 12 |
+
],
|
| 13 |
+
"audios": [
|
| 14 |
+
"mllm_demo_data/1.mp3"
|
| 15 |
+
]
|
| 16 |
+
},
|
| 17 |
+
{
|
| 18 |
+
"messages": [
|
| 19 |
+
{
|
| 20 |
+
"content": "<audio>What can you hear?",
|
| 21 |
+
"role": "user"
|
| 22 |
+
},
|
| 23 |
+
{
|
| 24 |
+
"content": "A woman is coughing.",
|
| 25 |
+
"role": "assistant"
|
| 26 |
+
}
|
| 27 |
+
],
|
| 28 |
+
"audios": [
|
| 29 |
+
"mllm_demo_data/2.wav"
|
| 30 |
+
]
|
| 31 |
+
},
|
| 32 |
+
{
|
| 33 |
+
"messages": [
|
| 34 |
+
{
|
| 35 |
+
"content": "<audio>What does the person say?",
|
| 36 |
+
"role": "user"
|
| 37 |
+
},
|
| 38 |
+
{
|
| 39 |
+
"content": "Mister Quiller is the apostle of the middle classes and we are glad to welcome his gospel.",
|
| 40 |
+
"role": "assistant"
|
| 41 |
+
}
|
| 42 |
+
],
|
| 43 |
+
"audios": [
|
| 44 |
+
"mllm_demo_data/3.flac"
|
| 45 |
+
]
|
| 46 |
+
}
|
| 47 |
+
]
|
data/mllm_demo.json
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[
|
| 2 |
+
{
|
| 3 |
+
"messages": [
|
| 4 |
+
{
|
| 5 |
+
"content": "<image>Who are they?",
|
| 6 |
+
"role": "user"
|
| 7 |
+
},
|
| 8 |
+
{
|
| 9 |
+
"content": "They're Kane and Gretzka from Bayern Munich.",
|
| 10 |
+
"role": "assistant"
|
| 11 |
+
},
|
| 12 |
+
{
|
| 13 |
+
"content": "What are they doing?<image>",
|
| 14 |
+
"role": "user"
|
| 15 |
+
},
|
| 16 |
+
{
|
| 17 |
+
"content": "They are celebrating on the soccer field.",
|
| 18 |
+
"role": "assistant"
|
| 19 |
+
}
|
| 20 |
+
],
|
| 21 |
+
"images": [
|
| 22 |
+
"mllm_demo_data/1.jpg",
|
| 23 |
+
"mllm_demo_data/1.jpg"
|
| 24 |
+
]
|
| 25 |
+
},
|
| 26 |
+
{
|
| 27 |
+
"messages": [
|
| 28 |
+
{
|
| 29 |
+
"content": "<image>Who is he?",
|
| 30 |
+
"role": "user"
|
| 31 |
+
},
|
| 32 |
+
{
|
| 33 |
+
"content": "He's Thomas Muller from Bayern Munich.",
|
| 34 |
+
"role": "assistant"
|
| 35 |
+
},
|
| 36 |
+
{
|
| 37 |
+
"content": "Why is he on the ground?",
|
| 38 |
+
"role": "user"
|
| 39 |
+
},
|
| 40 |
+
{
|
| 41 |
+
"content": "Because he's sliding on his knees to celebrate.",
|
| 42 |
+
"role": "assistant"
|
| 43 |
+
}
|
| 44 |
+
],
|
| 45 |
+
"images": [
|
| 46 |
+
"mllm_demo_data/2.jpg"
|
| 47 |
+
]
|
| 48 |
+
},
|
| 49 |
+
{
|
| 50 |
+
"messages": [
|
| 51 |
+
{
|
| 52 |
+
"content": "<image>Please describe this image",
|
| 53 |
+
"role": "user"
|
| 54 |
+
},
|
| 55 |
+
{
|
| 56 |
+
"content": "Chinese astronaut Gui Haichao is giving a speech.",
|
| 57 |
+
"role": "assistant"
|
| 58 |
+
},
|
| 59 |
+
{
|
| 60 |
+
"content": "What has he accomplished?",
|
| 61 |
+
"role": "user"
|
| 62 |
+
},
|
| 63 |
+
{
|
| 64 |
+
"content": "He was appointed to be a payload specialist on Shenzhou 16 mission in June 2022, thus becoming the first Chinese civilian of Group 3 in space on 30 May 2023. He is responsible for the on-orbit operation of space science experimental payloads.",
|
| 65 |
+
"role": "assistant"
|
| 66 |
+
}
|
| 67 |
+
],
|
| 68 |
+
"images": [
|
| 69 |
+
"mllm_demo_data/3.jpg"
|
| 70 |
+
]
|
| 71 |
+
},
|
| 72 |
+
{
|
| 73 |
+
"messages": [
|
| 74 |
+
{
|
| 75 |
+
"content": "<image>他们是谁?",
|
| 76 |
+
"role": "user"
|
| 77 |
+
},
|
| 78 |
+
{
|
| 79 |
+
"content": "他们是拜仁慕尼黑的凯恩和格雷茨卡。",
|
| 80 |
+
"role": "assistant"
|
| 81 |
+
},
|
| 82 |
+
{
|
| 83 |
+
"content": "他们在做什么?<image>",
|
| 84 |
+
"role": "user"
|
| 85 |
+
},
|
| 86 |
+
{
|
| 87 |
+
"content": "他们在足球场上庆祝。",
|
| 88 |
+
"role": "assistant"
|
| 89 |
+
}
|
| 90 |
+
],
|
| 91 |
+
"images": [
|
| 92 |
+
"mllm_demo_data/1.jpg",
|
| 93 |
+
"mllm_demo_data/1.jpg"
|
| 94 |
+
]
|
| 95 |
+
},
|
| 96 |
+
{
|
| 97 |
+
"messages": [
|
| 98 |
+
{
|
| 99 |
+
"content": "<image>他是谁?",
|
| 100 |
+
"role": "user"
|
| 101 |
+
},
|
| 102 |
+
{
|
| 103 |
+
"content": "他是来自拜仁慕尼黑的托马斯·穆勒。",
|
| 104 |
+
"role": "assistant"
|
| 105 |
+
},
|
| 106 |
+
{
|
| 107 |
+
"content": "他为什么在地上?",
|
| 108 |
+
"role": "user"
|
| 109 |
+
},
|
| 110 |
+
{
|
| 111 |
+
"content": "因为他正在双膝跪地滑行庆祝。",
|
| 112 |
+
"role": "assistant"
|
| 113 |
+
}
|
| 114 |
+
],
|
| 115 |
+
"images": [
|
| 116 |
+
"mllm_demo_data/2.jpg"
|
| 117 |
+
]
|
| 118 |
+
},
|
| 119 |
+
{
|
| 120 |
+
"messages": [
|
| 121 |
+
{
|
| 122 |
+
"content": "<image>请描述这张图片",
|
| 123 |
+
"role": "user"
|
| 124 |
+
},
|
| 125 |
+
{
|
| 126 |
+
"content": "中国宇航员桂海潮正在讲话。",
|
| 127 |
+
"role": "assistant"
|
| 128 |
+
},
|
| 129 |
+
{
|
| 130 |
+
"content": "他取得过哪些成就?",
|
| 131 |
+
"role": "user"
|
| 132 |
+
},
|
| 133 |
+
{
|
| 134 |
+
"content": "他于2022年6月被任命为神舟十六号任务的有效载荷专家,从而成为2023年5月30日进入太空的首位平民宇航员。他负责在轨操作空间科学实验有效载荷。",
|
| 135 |
+
"role": "assistant"
|
| 136 |
+
}
|
| 137 |
+
],
|
| 138 |
+
"images": [
|
| 139 |
+
"mllm_demo_data/3.jpg"
|
| 140 |
+
]
|
| 141 |
+
}
|
| 142 |
+
]
|
data/mllm_demo_data/1.jpg
ADDED
|
data/mllm_demo_data/1.mp3
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4a1a83e5c7fc5c0842abf39e0be7051e3ecfeb5337a1e5371a2f631efe5ca45d
|
| 3 |
+
size 129024
|
data/mllm_demo_data/1.mp4
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3298926dcbd76709eb64cc194ec9fe0f81865149086c9b2acd935d92e8d8d57e
|
| 3 |
+
size 481185
|
data/mllm_demo_data/2.avi
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:fb4fa70ba4a62ebfe74c6aa90172e8c714122c058d285e5d5560d24042063d36
|
| 3 |
+
size 385746
|
data/mllm_demo_data/2.jpg
ADDED
|
data/mllm_demo_data/2.wav
ADDED
|
Binary file (92.9 kB). View file
|
|
|
data/mllm_demo_data/3.flac
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4e25e22555cd16e90edb0a3b49fdcf1fe652b2a1250ab643634db33895c75b41
|
| 3 |
+
size 120041
|
data/mllm_demo_data/3.jpg
ADDED
|
data/mllm_demo_data/3.mp4
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c8f88dd5ce9dab723864bdf508a5656378f7cbb2b35399d33bc1c8ae9d3ef73f
|
| 3 |
+
size 270849
|
data/mllm_demo_data/4.mp3
ADDED
|
Binary file (80.9 kB). View file
|
|
|
data/mllm_demo_data/4.mp4
ADDED
|
Binary file (68.1 kB). View file
|
|
|
data/mllm_video_audio_demo.json
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[
|
| 2 |
+
{
|
| 3 |
+
"messages": [
|
| 4 |
+
{
|
| 5 |
+
"content": "<video><audio>What is the video describing?",
|
| 6 |
+
"role": "user"
|
| 7 |
+
},
|
| 8 |
+
{
|
| 9 |
+
"content": "A girl who is drawing a picture of a guitar and feel nervous.",
|
| 10 |
+
"role": "assistant"
|
| 11 |
+
}
|
| 12 |
+
],
|
| 13 |
+
"videos": [
|
| 14 |
+
"mllm_demo_data/4.mp4"
|
| 15 |
+
],
|
| 16 |
+
"audios": [
|
| 17 |
+
"mllm_demo_data/4.mp3"
|
| 18 |
+
]
|
| 19 |
+
},
|
| 20 |
+
{
|
| 21 |
+
"messages": [
|
| 22 |
+
{
|
| 23 |
+
"content": "<video><audio>What does this girl say?",
|
| 24 |
+
"role": "user"
|
| 25 |
+
},
|
| 26 |
+
{
|
| 27 |
+
"content": "She says: 'Hello! Take a look at what am I drawing!'",
|
| 28 |
+
"role": "assistant"
|
| 29 |
+
}
|
| 30 |
+
],
|
| 31 |
+
"videos": [
|
| 32 |
+
"mllm_demo_data/4.mp4"
|
| 33 |
+
],
|
| 34 |
+
"audios": [
|
| 35 |
+
"mllm_demo_data/4.mp3"
|
| 36 |
+
]
|
| 37 |
+
},
|
| 38 |
+
{
|
| 39 |
+
"messages": [
|
| 40 |
+
{
|
| 41 |
+
"content": "<video><audio>What is this girl drawing with?",
|
| 42 |
+
"role": "user"
|
| 43 |
+
},
|
| 44 |
+
{
|
| 45 |
+
"content": "She is drawing with an iPad.",
|
| 46 |
+
"role": "assistant"
|
| 47 |
+
}
|
| 48 |
+
],
|
| 49 |
+
"videos": [
|
| 50 |
+
"mllm_demo_data/4.mp4"
|
| 51 |
+
],
|
| 52 |
+
"audios": [
|
| 53 |
+
"mllm_demo_data/4.mp3"
|
| 54 |
+
]
|
| 55 |
+
}
|
| 56 |
+
]
|
data/mllm_video_demo.json
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[
|
| 2 |
+
{
|
| 3 |
+
"messages": [
|
| 4 |
+
{
|
| 5 |
+
"content": "<video>Why is this video funny?",
|
| 6 |
+
"role": "user"
|
| 7 |
+
},
|
| 8 |
+
{
|
| 9 |
+
"content": "Because a baby is reading, and he is so cute!",
|
| 10 |
+
"role": "assistant"
|
| 11 |
+
}
|
| 12 |
+
],
|
| 13 |
+
"videos": [
|
| 14 |
+
"mllm_demo_data/1.mp4"
|
| 15 |
+
]
|
| 16 |
+
},
|
| 17 |
+
{
|
| 18 |
+
"messages": [
|
| 19 |
+
{
|
| 20 |
+
"content": "<video>What is she doing?",
|
| 21 |
+
"role": "user"
|
| 22 |
+
},
|
| 23 |
+
{
|
| 24 |
+
"content": "She is cooking.",
|
| 25 |
+
"role": "assistant"
|
| 26 |
+
}
|
| 27 |
+
],
|
| 28 |
+
"videos": [
|
| 29 |
+
"mllm_demo_data/2.avi"
|
| 30 |
+
]
|
| 31 |
+
},
|
| 32 |
+
{
|
| 33 |
+
"messages": [
|
| 34 |
+
{
|
| 35 |
+
"content": "<video>What's in the video?",
|
| 36 |
+
"role": "user"
|
| 37 |
+
},
|
| 38 |
+
{
|
| 39 |
+
"content": "A baby is playing in the living room.",
|
| 40 |
+
"role": "assistant"
|
| 41 |
+
}
|
| 42 |
+
],
|
| 43 |
+
"videos": [
|
| 44 |
+
"mllm_demo_data/3.mp4"
|
| 45 |
+
]
|
| 46 |
+
}
|
| 47 |
+
]
|
data/reason_tool_use_demo_50.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/v1_sft_demo.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/v1_sft_demo.yaml
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
identity:
|
| 2 |
+
file_name: identity.json
|
| 3 |
+
converter: alpaca
|
| 4 |
+
alpaca_en_demo:
|
| 5 |
+
file_name: alpaca_en_demo.json
|
| 6 |
+
dataset_dir: ~/data
|
| 7 |
+
converter: alpaca
|
| 8 |
+
num_samples: 500
|
data/wiki_demo.txt
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
eval_scan2cap.sh
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
#SBATCH -p Gveval # 队列名称
|
| 3 |
+
#SBATCH --quotatype=spot # 竞价类型
|
| 4 |
+
#SBATCH --nodes=1 # 节点数量
|
| 5 |
+
#SBATCH --ntasks=8 # 总进程数(与GPU数量一致)
|
| 6 |
+
#SBATCH --gres=gpu:8 # 每张卡分配的GPU数量
|
| 7 |
+
#SBATCH --cpus-per-task=16 # 每个进程分配的CPU核心数
|
| 8 |
+
#SBATCH --job-name=qwen_train # 任务名称(自定义)
|
| 9 |
+
#SBATCH --requeue # 任务重排,当任务被别人抢断后,可以重新排队,但需要程序自动处理resume
|
| 10 |
+
#SBATCH --open-mode append # 日志写入方式
|
| 11 |
+
|
| 12 |
+
export http_proxy=http://hanjiaming:DXtIkuMPmgy3M3UnCrRhGIxSMMaZn8iit2Br6UdG32fscs2l1bKKQ690WYTC@10.1.20.50:23128/
|
| 13 |
+
export https_proxy=http://hanjiaming:DXtIkuMPmgy3M3UnCrRhGIxSMMaZn8iit2Br6UdG32fscs2l1bKKQ690WYTC@10.1.20.50:23128/
|
| 14 |
+
export HTTP_PROXY=http://hanjiaming:DXtIkuMPmgy3M3UnCrRhGIxSMMaZn8iit2Br6UdG32fscs2l1bKKQ690WYTC@10.1.20.50:23128/
|
| 15 |
+
export HTTPS_PROXY=http://hanjiaming:DXtIkuMPmgy3M3UnCrRhGIxSMMaZn8iit2Br6UdG32fscs2l1bKKQ690WYTC@10.1.20.50:23128/ ;
|
| 16 |
+
|
| 17 |
+
export LMMS_EVAL_LAUNCHER="accelerate"
|
| 18 |
+
|
| 19 |
+
benchmark=scan2cap # choices: [scan2cap, scanrefer, scannet_4frames, scannet_6frames]
|
| 20 |
+
output_path=logs/$(TZ="Asia/Shanghai" date "+%Y%m%d")
|
| 21 |
+
model_path=ckpts/Qwen2.5-Omni-3B-sftv2-full
|
| 22 |
+
|
| 23 |
+
model_args_str="pretrained=$model_path,attn_implementation=flash_attention_2,max_num_frames=32"
|
| 24 |
+
|
| 25 |
+
export PYTHONPATH=$(pwd)/src:$PYTHONPATH
|
| 26 |
+
export TOKENIZERS_PARALLELISM=true
|
| 27 |
+
|
| 28 |
+
apptainer exec -f -w --nv --bind /mnt:/mnt /mnt/petrelfs/hanjiaming/llama_factory/ \
|
| 29 |
+
accelerate launch --num_processes=8 --main_process_port 29503 -m lmms_eval \
|
| 30 |
+
--model qwen2_5_omni \
|
| 31 |
+
--model_args "$model_args_str" \
|
| 32 |
+
--tasks ${benchmark} \
|
| 33 |
+
--batch_size 1 \
|
| 34 |
+
--log_samples_suffix original \
|
| 35 |
+
--log_samples \
|
| 36 |
+
--output_path $output_path
|
eval_threeod.sh
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
#SBATCH -p Gveval # 队列名称
|
| 3 |
+
#SBATCH --quotatype=spot # 竞价类型
|
| 4 |
+
#SBATCH --nodes=1 # 节点数量
|
| 5 |
+
#SBATCH --ntasks=8 # 总进程数(与GPU数量一致)
|
| 6 |
+
#SBATCH --gres=gpu:8 # 每张卡分配的GPU数量
|
| 7 |
+
#SBATCH --cpus-per-task=16 # 每个进程分配的CPU核心数
|
| 8 |
+
#SBATCH --job-name=qwen_train # 任务名称(自定义)
|
| 9 |
+
#SBATCH --requeue # 任务重排,当任务被别人抢断后,可以重新排队,但需要程序自动处理resume
|
| 10 |
+
#SBATCH --open-mode append # 日志写入方式
|
| 11 |
+
|
| 12 |
+
export http_proxy=http://hanjiaming:DXtIkuMPmgy3M3UnCrRhGIxSMMaZn8iit2Br6UdG32fscs2l1bKKQ690WYTC@10.1.20.50:23128/
|
| 13 |
+
export https_proxy=http://hanjiaming:DXtIkuMPmgy3M3UnCrRhGIxSMMaZn8iit2Br6UdG32fscs2l1bKKQ690WYTC@10.1.20.50:23128/
|
| 14 |
+
export HTTP_PROXY=http://hanjiaming:DXtIkuMPmgy3M3UnCrRhGIxSMMaZn8iit2Br6UdG32fscs2l1bKKQ690WYTC@10.1.20.50:23128/
|
| 15 |
+
export HTTPS_PROXY=http://hanjiaming:DXtIkuMPmgy3M3UnCrRhGIxSMMaZn8iit2Br6UdG32fscs2l1bKKQ690WYTC@10.1.20.50:23128/ ;
|
| 16 |
+
|
| 17 |
+
export LMMS_EVAL_LAUNCHER="accelerate"
|
| 18 |
+
|
| 19 |
+
benchmark=scannet_6frames # choices: [scan2cap, scanrefer, scannet_4frames, scannet_6frames]
|
| 20 |
+
output_path=logs/$(TZ="Asia/Shanghai" date "+%Y%m%d")
|
| 21 |
+
model_path=ckpts/Qwen2.5-Omni-3B-sftv2-full
|
| 22 |
+
|
| 23 |
+
model_args_str="pretrained=$model_path,attn_implementation=flash_attention_2,max_num_frames=32"
|
| 24 |
+
|
| 25 |
+
export PYTHONPATH=$(pwd)/src:$PYTHONPATH
|
| 26 |
+
export TOKENIZERS_PARALLELISM=true
|
| 27 |
+
|
| 28 |
+
apptainer exec -f -w --nv --bind /mnt:/mnt /mnt/petrelfs/hanjiaming/llama_factory/ \
|
| 29 |
+
accelerate launch --num_processes=8 --main_process_port 29503 -m lmms_eval \
|
| 30 |
+
--model qwen2_5_omni \
|
| 31 |
+
--model_args "$model_args_str" \
|
| 32 |
+
--tasks ${benchmark} \
|
| 33 |
+
--batch_size 1 \
|
| 34 |
+
--log_samples_suffix original \
|
| 35 |
+
--log_samples \
|
| 36 |
+
--output_path $output_path
|
examples/README.md
ADDED
|
@@ -0,0 +1,304 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
We provide diverse examples about fine-tuning LLMs.
|
| 2 |
+
|
| 3 |
+
Make sure to execute these commands in the `LLaMA-Factory` directory.
|
| 4 |
+
|
| 5 |
+
## Table of Contents
|
| 6 |
+
|
| 7 |
+
- [LoRA Fine-Tuning](#lora-fine-tuning)
|
| 8 |
+
- [QLoRA Fine-Tuning](#qlora-fine-tuning)
|
| 9 |
+
- [Full-Parameter Fine-Tuning](#full-parameter-fine-tuning)
|
| 10 |
+
- [Merging LoRA Adapters and Quantization](#merging-lora-adapters-and-quantization)
|
| 11 |
+
- [Inferring LoRA Fine-Tuned Models](#inferring-lora-fine-tuned-models)
|
| 12 |
+
- [Extras](#extras)
|
| 13 |
+
|
| 14 |
+
Use `CUDA_VISIBLE_DEVICES` (GPU) or `ASCEND_RT_VISIBLE_DEVICES` (NPU) to choose computing devices.
|
| 15 |
+
|
| 16 |
+
By default, LLaMA-Factory uses all visible computing devices.
|
| 17 |
+
|
| 18 |
+
Basic usage:
|
| 19 |
+
|
| 20 |
+
```bash
|
| 21 |
+
llamafactory-cli train examples/train_lora/llama3_lora_sft.yaml
|
| 22 |
+
```
|
| 23 |
+
|
| 24 |
+
Advanced usage:
|
| 25 |
+
|
| 26 |
+
```bash
|
| 27 |
+
CUDA_VISIBLE_DEVICES=0,1 llamafactory-cli train examples/train_lora/llama3_lora_sft.yaml \
|
| 28 |
+
learning_rate=1e-5 \
|
| 29 |
+
logging_steps=1
|
| 30 |
+
```
|
| 31 |
+
|
| 32 |
+
```bash
|
| 33 |
+
bash examples/train_lora/llama3_lora_sft.sh
|
| 34 |
+
```
|
| 35 |
+
|
| 36 |
+
## Examples
|
| 37 |
+
|
| 38 |
+
### LoRA Fine-Tuning
|
| 39 |
+
|
| 40 |
+
#### (Continuous) Pre-Training
|
| 41 |
+
|
| 42 |
+
```bash
|
| 43 |
+
llamafactory-cli train examples/train_lora/llama3_lora_pretrain.yaml
|
| 44 |
+
```
|
| 45 |
+
|
| 46 |
+
#### Supervised Fine-Tuning
|
| 47 |
+
|
| 48 |
+
```bash
|
| 49 |
+
llamafactory-cli train examples/train_lora/llama3_lora_sft.yaml
|
| 50 |
+
```
|
| 51 |
+
|
| 52 |
+
#### Multimodal Supervised Fine-Tuning
|
| 53 |
+
|
| 54 |
+
```bash
|
| 55 |
+
llamafactory-cli train examples/train_lora/qwen2_5vl_lora_sft.yaml
|
| 56 |
+
```
|
| 57 |
+
|
| 58 |
+
#### DPO/ORPO/SimPO Training
|
| 59 |
+
|
| 60 |
+
```bash
|
| 61 |
+
llamafactory-cli train examples/train_lora/llama3_lora_dpo.yaml
|
| 62 |
+
```
|
| 63 |
+
|
| 64 |
+
#### Multimodal DPO/ORPO/SimPO Training
|
| 65 |
+
|
| 66 |
+
```bash
|
| 67 |
+
llamafactory-cli train examples/train_lora/qwen2_5vl_lora_dpo.yaml
|
| 68 |
+
```
|
| 69 |
+
|
| 70 |
+
#### Reward Modeling
|
| 71 |
+
|
| 72 |
+
```bash
|
| 73 |
+
llamafactory-cli train examples/train_lora/llama3_lora_reward.yaml
|
| 74 |
+
```
|
| 75 |
+
|
| 76 |
+
#### PPO Training
|
| 77 |
+
|
| 78 |
+
```bash
|
| 79 |
+
llamafactory-cli train examples/train_lora/llama3_lora_ppo.yaml
|
| 80 |
+
```
|
| 81 |
+
|
| 82 |
+
#### KTO Training
|
| 83 |
+
|
| 84 |
+
```bash
|
| 85 |
+
llamafactory-cli train examples/train_lora/llama3_lora_kto.yaml
|
| 86 |
+
```
|
| 87 |
+
|
| 88 |
+
#### Preprocess Dataset
|
| 89 |
+
|
| 90 |
+
It is useful for large dataset, use `tokenized_path` in config to load the preprocessed dataset.
|
| 91 |
+
|
| 92 |
+
```bash
|
| 93 |
+
llamafactory-cli train examples/train_lora/llama3_preprocess.yaml
|
| 94 |
+
```
|
| 95 |
+
|
| 96 |
+
#### Evaluating on MMLU/CMMLU/C-Eval Benchmarks
|
| 97 |
+
|
| 98 |
+
```bash
|
| 99 |
+
llamafactory-cli eval examples/train_lora/llama3_lora_eval.yaml
|
| 100 |
+
```
|
| 101 |
+
|
| 102 |
+
#### Supervised Fine-Tuning on Multiple Nodes
|
| 103 |
+
|
| 104 |
+
```bash
|
| 105 |
+
FORCE_TORCHRUN=1 NNODES=2 NODE_RANK=0 MASTER_ADDR=192.168.0.1 MASTER_PORT=29500 llamafactory-cli train examples/train_lora/llama3_lora_sft.yaml
|
| 106 |
+
FORCE_TORCHRUN=1 NNODES=2 NODE_RANK=1 MASTER_ADDR=192.168.0.1 MASTER_PORT=29500 llamafactory-cli train examples/train_lora/llama3_lora_sft.yaml
|
| 107 |
+
```
|
| 108 |
+
|
| 109 |
+
#### Supervised Fine-Tuning with DeepSpeed ZeRO-3 (Weight Sharding)
|
| 110 |
+
|
| 111 |
+
```bash
|
| 112 |
+
FORCE_TORCHRUN=1 llamafactory-cli train examples/train_lora/llama3_lora_sft_ds3.yaml
|
| 113 |
+
```
|
| 114 |
+
|
| 115 |
+
#### Supervised Fine-Tuning with Ray on 4 GPUs
|
| 116 |
+
|
| 117 |
+
```bash
|
| 118 |
+
USE_RAY=1 llamafactory-cli train examples/train_lora/llama3_lora_sft_ray.yaml
|
| 119 |
+
```
|
| 120 |
+
|
| 121 |
+
### QLoRA Fine-Tuning
|
| 122 |
+
|
| 123 |
+
#### Supervised Fine-Tuning with 4/8-bit Bitsandbytes/HQQ/EETQ Quantization (Recommended)
|
| 124 |
+
|
| 125 |
+
```bash
|
| 126 |
+
llamafactory-cli train examples/train_qlora/llama3_lora_sft_otfq.yaml
|
| 127 |
+
```
|
| 128 |
+
|
| 129 |
+
#### Supervised Fine-Tuning with 4-bit Bitsandbytes Quantization on Ascend NPU
|
| 130 |
+
|
| 131 |
+
```bash
|
| 132 |
+
llamafactory-cli train examples/train_qlora/llama3_lora_sft_bnb_npu.yaml
|
| 133 |
+
```
|
| 134 |
+
|
| 135 |
+
#### Supervised Fine-Tuning with 4/8-bit GPTQ Quantization
|
| 136 |
+
|
| 137 |
+
```bash
|
| 138 |
+
llamafactory-cli train examples/train_qlora/llama3_lora_sft_gptq.yaml
|
| 139 |
+
```
|
| 140 |
+
|
| 141 |
+
#### Supervised Fine-Tuning with 4-bit AWQ Quantization
|
| 142 |
+
|
| 143 |
+
```bash
|
| 144 |
+
llamafactory-cli train examples/train_qlora/llama3_lora_sft_awq.yaml
|
| 145 |
+
```
|
| 146 |
+
|
| 147 |
+
#### Supervised Fine-Tuning with 2-bit AQLM Quantization
|
| 148 |
+
|
| 149 |
+
```bash
|
| 150 |
+
llamafactory-cli train examples/train_qlora/llama3_lora_sft_aqlm.yaml
|
| 151 |
+
```
|
| 152 |
+
|
| 153 |
+
### Full-Parameter Fine-Tuning
|
| 154 |
+
|
| 155 |
+
#### Supervised Fine-Tuning on Single Node
|
| 156 |
+
|
| 157 |
+
```bash
|
| 158 |
+
FORCE_TORCHRUN=1 llamafactory-cli train examples/train_full/llama3_full_sft.yaml
|
| 159 |
+
```
|
| 160 |
+
|
| 161 |
+
#### Supervised Fine-Tuning on Multiple Nodes
|
| 162 |
+
|
| 163 |
+
```bash
|
| 164 |
+
FORCE_TORCHRUN=1 NNODES=2 NODE_RANK=0 MASTER_ADDR=192.168.0.1 MASTER_PORT=29500 llamafactory-cli train examples/train_full/llama3_full_sft.yaml
|
| 165 |
+
FORCE_TORCHRUN=1 NNODES=2 NODE_RANK=1 MASTER_ADDR=192.168.0.1 MASTER_PORT=29500 llamafactory-cli train examples/train_full/llama3_full_sft.yaml
|
| 166 |
+
```
|
| 167 |
+
|
| 168 |
+
### Elastic and Fault-Tolerant Supervised Fine-Tuning on Multiple Nodes
|
| 169 |
+
|
| 170 |
+
To launch an elastic job with `MAX_RESTARTS` failures retries, run the following on at least `MIN_NNODES` nodes and at most `MAX_NNODES` nodes. `RDZV_ID` should be set as a unique job id (shared by all nodes participating in the job). See also [torchrun](https://docs.pytorch.org/docs/stable/elastic/run.html).
|
| 171 |
+
|
| 172 |
+
```bash
|
| 173 |
+
FORCE_TORCHRUN=1 MIN_NNODES=1 MAX_NNODES=3 MAX_RESTARTS=3 RDZV_ID=llamafactory MASTER_ADDR=192.168.0.1 MASTER_PORT=29500 llamafactory-cli train examples/train_full/llama3_full_sft.yaml
|
| 174 |
+
```
|
| 175 |
+
|
| 176 |
+
#### Multimodal Supervised Fine-Tuning
|
| 177 |
+
|
| 178 |
+
```bash
|
| 179 |
+
FORCE_TORCHRUN=1 llamafactory-cli train examples/train_full/qwen2_5vl_full_sft.yaml
|
| 180 |
+
```
|
| 181 |
+
|
| 182 |
+
### Merging LoRA Adapters and Quantization
|
| 183 |
+
|
| 184 |
+
#### Merge LoRA Adapters
|
| 185 |
+
|
| 186 |
+
Note: DO NOT use quantized model or `quantization_bit` when merging LoRA adapters.
|
| 187 |
+
|
| 188 |
+
```bash
|
| 189 |
+
llamafactory-cli export examples/merge_lora/llama3_lora_sft.yaml
|
| 190 |
+
```
|
| 191 |
+
|
| 192 |
+
#### Quantizing Model using AutoGPTQ
|
| 193 |
+
|
| 194 |
+
```bash
|
| 195 |
+
llamafactory-cli export examples/merge_lora/llama3_gptq.yaml
|
| 196 |
+
```
|
| 197 |
+
|
| 198 |
+
### Save Ollama modelfile
|
| 199 |
+
|
| 200 |
+
```bash
|
| 201 |
+
llamafactory-cli export examples/merge_lora/llama3_full_sft.yaml
|
| 202 |
+
```
|
| 203 |
+
|
| 204 |
+
### Inferring LoRA Fine-Tuned Models
|
| 205 |
+
|
| 206 |
+
#### Evaluation using vLLM's Multi-GPU Inference
|
| 207 |
+
|
| 208 |
+
```
|
| 209 |
+
python scripts/vllm_infer.py --model_name_or_path meta-llama/Meta-Llama-3-8B-Instruct --template llama3 --dataset alpaca_en_demo
|
| 210 |
+
python scripts/eval_bleu_rouge.py generated_predictions.jsonl
|
| 211 |
+
```
|
| 212 |
+
|
| 213 |
+
#### Use CLI ChatBox
|
| 214 |
+
|
| 215 |
+
```bash
|
| 216 |
+
llamafactory-cli chat examples/inference/llama3_lora_sft.yaml
|
| 217 |
+
```
|
| 218 |
+
|
| 219 |
+
#### Use Web UI ChatBox
|
| 220 |
+
|
| 221 |
+
```bash
|
| 222 |
+
llamafactory-cli webchat examples/inference/llama3_lora_sft.yaml
|
| 223 |
+
```
|
| 224 |
+
|
| 225 |
+
#### Launch OpenAI-style API
|
| 226 |
+
|
| 227 |
+
```bash
|
| 228 |
+
llamafactory-cli api examples/inference/llama3_lora_sft.yaml
|
| 229 |
+
```
|
| 230 |
+
|
| 231 |
+
### Extras
|
| 232 |
+
|
| 233 |
+
#### Full-Parameter Fine-Tuning using GaLore
|
| 234 |
+
|
| 235 |
+
```bash
|
| 236 |
+
llamafactory-cli train examples/extras/galore/llama3_full_sft.yaml
|
| 237 |
+
```
|
| 238 |
+
|
| 239 |
+
#### Full-Parameter Fine-Tuning using APOLLO
|
| 240 |
+
|
| 241 |
+
```bash
|
| 242 |
+
llamafactory-cli train examples/extras/apollo/llama3_full_sft.yaml
|
| 243 |
+
```
|
| 244 |
+
|
| 245 |
+
#### Full-Parameter Fine-Tuning using BAdam
|
| 246 |
+
|
| 247 |
+
```bash
|
| 248 |
+
llamafactory-cli train examples/extras/badam/llama3_full_sft.yaml
|
| 249 |
+
```
|
| 250 |
+
|
| 251 |
+
#### Full-Parameter Fine-Tuning using Adam-mini
|
| 252 |
+
|
| 253 |
+
```bash
|
| 254 |
+
llamafactory-cli train examples/extras/adam_mini/qwen2_full_sft.yaml
|
| 255 |
+
```
|
| 256 |
+
|
| 257 |
+
#### Full-Parameter Fine-Tuning using Muon
|
| 258 |
+
|
| 259 |
+
```bash
|
| 260 |
+
llamafactory-cli train examples/extras/muon/qwen2_full_sft.yaml
|
| 261 |
+
```
|
| 262 |
+
|
| 263 |
+
#### LoRA+ Fine-Tuning
|
| 264 |
+
|
| 265 |
+
```bash
|
| 266 |
+
llamafactory-cli train examples/extras/loraplus/llama3_lora_sft.yaml
|
| 267 |
+
```
|
| 268 |
+
|
| 269 |
+
#### PiSSA Fine-Tuning
|
| 270 |
+
|
| 271 |
+
```bash
|
| 272 |
+
llamafactory-cli train examples/extras/pissa/llama3_lora_sft.yaml
|
| 273 |
+
```
|
| 274 |
+
|
| 275 |
+
#### Mixture-of-Depths Fine-Tuning
|
| 276 |
+
|
| 277 |
+
```bash
|
| 278 |
+
llamafactory-cli train examples/extras/mod/llama3_full_sft.yaml
|
| 279 |
+
```
|
| 280 |
+
|
| 281 |
+
#### LLaMA-Pro Fine-Tuning
|
| 282 |
+
|
| 283 |
+
```bash
|
| 284 |
+
bash examples/extras/llama_pro/expand.sh
|
| 285 |
+
llamafactory-cli train examples/extras/llama_pro/llama3_freeze_sft.yaml
|
| 286 |
+
```
|
| 287 |
+
|
| 288 |
+
#### FSDP+QLoRA Fine-Tuning
|
| 289 |
+
|
| 290 |
+
```bash
|
| 291 |
+
bash examples/extras/fsdp_qlora/train.sh
|
| 292 |
+
```
|
| 293 |
+
|
| 294 |
+
#### OFT Fine-Tuning
|
| 295 |
+
|
| 296 |
+
```bash
|
| 297 |
+
llamafactory-cli train examples/extras/oft/llama3_oft_sft.yaml
|
| 298 |
+
```
|
| 299 |
+
|
| 300 |
+
#### QOFT Fine-Tuning
|
| 301 |
+
|
| 302 |
+
```bash
|
| 303 |
+
llamafactory-cli train examples/extras/qoft/llama3_oft_sft_bnb_npu.yaml
|
| 304 |
+
```
|
examples/accelerate/fsdp_config.yaml
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
compute_environment: LOCAL_MACHINE
|
| 2 |
+
debug: false
|
| 3 |
+
distributed_type: FSDP
|
| 4 |
+
downcast_bf16: 'no'
|
| 5 |
+
fsdp_config:
|
| 6 |
+
fsdp_auto_wrap_policy: TRANSFORMER_BASED_WRAP
|
| 7 |
+
fsdp_backward_prefetch: BACKWARD_PRE
|
| 8 |
+
fsdp_forward_prefetch: false
|
| 9 |
+
fsdp_cpu_ram_efficient_loading: true
|
| 10 |
+
fsdp_offload_params: false
|
| 11 |
+
fsdp_sharding_strategy: FULL_SHARD
|
| 12 |
+
fsdp_state_dict_type: FULL_STATE_DICT
|
| 13 |
+
fsdp_sync_module_states: true
|
| 14 |
+
fsdp_use_orig_params: true
|
| 15 |
+
machine_rank: 0
|
| 16 |
+
main_training_function: main
|
| 17 |
+
mixed_precision: bf16 # or fp16
|
| 18 |
+
num_machines: 1 # the number of nodes
|
| 19 |
+
num_processes: 2 # the number of GPUs in all nodes
|
| 20 |
+
rdzv_backend: static
|
| 21 |
+
same_network: true
|
| 22 |
+
tpu_env: []
|
| 23 |
+
tpu_use_cluster: false
|
| 24 |
+
tpu_use_sudo: false
|
| 25 |
+
use_cpu: false
|
examples/accelerate/fsdp_config_offload.yaml
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
compute_environment: LOCAL_MACHINE
|
| 2 |
+
debug: false
|
| 3 |
+
distributed_type: FSDP
|
| 4 |
+
downcast_bf16: 'no'
|
| 5 |
+
fsdp_config:
|
| 6 |
+
fsdp_auto_wrap_policy: TRANSFORMER_BASED_WRAP
|
| 7 |
+
fsdp_backward_prefetch: BACKWARD_PRE
|
| 8 |
+
fsdp_forward_prefetch: false
|
| 9 |
+
fsdp_cpu_ram_efficient_loading: true
|
| 10 |
+
fsdp_offload_params: true # offload may affect training speed
|
| 11 |
+
fsdp_sharding_strategy: FULL_SHARD
|
| 12 |
+
fsdp_state_dict_type: FULL_STATE_DICT
|
| 13 |
+
fsdp_sync_module_states: true
|
| 14 |
+
fsdp_use_orig_params: true
|
| 15 |
+
machine_rank: 0
|
| 16 |
+
main_training_function: main
|
| 17 |
+
mixed_precision: bf16 # or fp16
|
| 18 |
+
num_machines: 1 # the number of nodes
|
| 19 |
+
num_processes: 2 # the number of GPUs in all nodes
|
| 20 |
+
rdzv_backend: static
|
| 21 |
+
same_network: true
|
| 22 |
+
tpu_env: []
|
| 23 |
+
tpu_use_cluster: false
|
| 24 |
+
tpu_use_sudo: false
|
| 25 |
+
use_cpu: false
|
examples/deepspeed/ds_z0_config.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"train_batch_size": "auto",
|
| 3 |
+
"train_micro_batch_size_per_gpu": "auto",
|
| 4 |
+
"gradient_accumulation_steps": "auto",
|
| 5 |
+
"gradient_clipping": "auto",
|
| 6 |
+
"zero_allow_untested_optimizer": true,
|
| 7 |
+
"fp16": {
|
| 8 |
+
"enabled": "auto",
|
| 9 |
+
"loss_scale": 0,
|
| 10 |
+
"loss_scale_window": 1000,
|
| 11 |
+
"initial_scale_power": 16,
|
| 12 |
+
"hysteresis": 2,
|
| 13 |
+
"min_loss_scale": 1
|
| 14 |
+
},
|
| 15 |
+
"bf16": {
|
| 16 |
+
"enabled": "auto"
|
| 17 |
+
},
|
| 18 |
+
"zero_optimization": {
|
| 19 |
+
"stage": 0,
|
| 20 |
+
"allgather_partitions": true,
|
| 21 |
+
"allgather_bucket_size": 5e8,
|
| 22 |
+
"overlap_comm": false,
|
| 23 |
+
"reduce_scatter": true,
|
| 24 |
+
"reduce_bucket_size": 5e8,
|
| 25 |
+
"contiguous_gradients": true,
|
| 26 |
+
"round_robin_gradients": true
|
| 27 |
+
}
|
| 28 |
+
}
|
examples/deepspeed/ds_z2_config.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"train_batch_size": "auto",
|
| 3 |
+
"train_micro_batch_size_per_gpu": "auto",
|
| 4 |
+
"gradient_accumulation_steps": "auto",
|
| 5 |
+
"gradient_clipping": "auto",
|
| 6 |
+
"zero_allow_untested_optimizer": true,
|
| 7 |
+
"fp16": {
|
| 8 |
+
"enabled": "auto",
|
| 9 |
+
"loss_scale": 0,
|
| 10 |
+
"loss_scale_window": 1000,
|
| 11 |
+
"initial_scale_power": 16,
|
| 12 |
+
"hysteresis": 2,
|
| 13 |
+
"min_loss_scale": 1
|
| 14 |
+
},
|
| 15 |
+
"bf16": {
|
| 16 |
+
"enabled": "auto"
|
| 17 |
+
},
|
| 18 |
+
"zero_optimization": {
|
| 19 |
+
"stage": 2,
|
| 20 |
+
"allgather_partitions": true,
|
| 21 |
+
"allgather_bucket_size": 5e8,
|
| 22 |
+
"overlap_comm": false,
|
| 23 |
+
"reduce_scatter": true,
|
| 24 |
+
"reduce_bucket_size": 5e8,
|
| 25 |
+
"contiguous_gradients": true,
|
| 26 |
+
"round_robin_gradients": true
|
| 27 |
+
}
|
| 28 |
+
}
|
examples/deepspeed/ds_z2_offload_config.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"train_batch_size": "auto",
|
| 3 |
+
"train_micro_batch_size_per_gpu": "auto",
|
| 4 |
+
"gradient_accumulation_steps": "auto",
|
| 5 |
+
"gradient_clipping": "auto",
|
| 6 |
+
"zero_allow_untested_optimizer": true,
|
| 7 |
+
"fp16": {
|
| 8 |
+
"enabled": "auto",
|
| 9 |
+
"loss_scale": 0,
|
| 10 |
+
"loss_scale_window": 1000,
|
| 11 |
+
"initial_scale_power": 16,
|
| 12 |
+
"hysteresis": 2,
|
| 13 |
+
"min_loss_scale": 1
|
| 14 |
+
},
|
| 15 |
+
"bf16": {
|
| 16 |
+
"enabled": "auto"
|
| 17 |
+
},
|
| 18 |
+
"zero_optimization": {
|
| 19 |
+
"stage": 2,
|
| 20 |
+
"offload_optimizer": {
|
| 21 |
+
"device": "cpu",
|
| 22 |
+
"pin_memory": true
|
| 23 |
+
},
|
| 24 |
+
"allgather_partitions": true,
|
| 25 |
+
"allgather_bucket_size": 5e8,
|
| 26 |
+
"overlap_comm": false,
|
| 27 |
+
"reduce_scatter": true,
|
| 28 |
+
"reduce_bucket_size": 5e8,
|
| 29 |
+
"contiguous_gradients": true,
|
| 30 |
+
"round_robin_gradients": true
|
| 31 |
+
}
|
| 32 |
+
}
|
examples/deepspeed/ds_z3_config.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"train_batch_size": "auto",
|
| 3 |
+
"train_micro_batch_size_per_gpu": "auto",
|
| 4 |
+
"gradient_accumulation_steps": "auto",
|
| 5 |
+
"gradient_clipping": "auto",
|
| 6 |
+
"zero_allow_untested_optimizer": true,
|
| 7 |
+
"fp16": {
|
| 8 |
+
"enabled": "auto",
|
| 9 |
+
"loss_scale": 0,
|
| 10 |
+
"loss_scale_window": 1000,
|
| 11 |
+
"initial_scale_power": 16,
|
| 12 |
+
"hysteresis": 2,
|
| 13 |
+
"min_loss_scale": 1
|
| 14 |
+
},
|
| 15 |
+
"bf16": {
|
| 16 |
+
"enabled": "auto"
|
| 17 |
+
},
|
| 18 |
+
"zero_optimization": {
|
| 19 |
+
"stage": 3,
|
| 20 |
+
"overlap_comm": false,
|
| 21 |
+
"contiguous_gradients": true,
|
| 22 |
+
"sub_group_size": 1e9,
|
| 23 |
+
"reduce_bucket_size": "auto",
|
| 24 |
+
"stage3_prefetch_bucket_size": "auto",
|
| 25 |
+
"stage3_param_persistence_threshold": "auto",
|
| 26 |
+
"stage3_max_live_parameters": 1e9,
|
| 27 |
+
"stage3_max_reuse_distance": 1e9,
|
| 28 |
+
"stage3_gather_16bit_weights_on_model_save": true
|
| 29 |
+
}
|
| 30 |
+
}
|