MallikaWy commited on
Commit
6cfa766
·
verified ·
1 Parent(s): 6d1eedf

Add files using upload-large-folder tool

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. InternVL/Qwen2.5-VL/LLaMA-Factory/.github/CODE_OF_CONDUCT.md +128 -0
  2. InternVL/Qwen2.5-VL/LLaMA-Factory/.github/CONTRIBUTING.md +67 -0
  3. InternVL/Qwen2.5-VL/LLaMA-Factory/.github/ISSUE_TEMPLATE/1-bug-report.yml +63 -0
  4. InternVL/Qwen2.5-VL/LLaMA-Factory/.github/ISSUE_TEMPLATE/2-feature-request.yml +41 -0
  5. InternVL/Qwen2.5-VL/LLaMA-Factory/.github/ISSUE_TEMPLATE/config.yml +1 -0
  6. InternVL/Qwen2.5-VL/LLaMA-Factory/.github/PULL_REQUEST_TEMPLATE.md +8 -0
  7. InternVL/Qwen2.5-VL/LLaMA-Factory/.github/SECURITY.md +7 -0
  8. InternVL/Qwen2.5-VL/LLaMA-Factory/.github/workflows/label_issue.yml +32 -0
  9. InternVL/Qwen2.5-VL/LLaMA-Factory/.github/workflows/publish.yml +40 -0
  10. InternVL/Qwen2.5-VL/LLaMA-Factory/.github/workflows/tests.yml +62 -0
  11. InternVL/Qwen2.5-VL/LLaMA-Factory/examples/deepspeed/ds_z0_config.json +28 -0
  12. InternVL/Qwen2.5-VL/LLaMA-Factory/examples/deepspeed/ds_z2_config.json +28 -0
  13. InternVL/Qwen2.5-VL/LLaMA-Factory/examples/deepspeed/ds_z2_offload_config.json +32 -0
  14. InternVL/Qwen2.5-VL/LLaMA-Factory/examples/deepspeed/ds_z3_config.json +30 -0
  15. InternVL/Qwen2.5-VL/LLaMA-Factory/examples/deepspeed/ds_z3_offload_config.json +38 -0
  16. InternVL/Qwen2.5-VL/LLaMA-Factory/examples/extras/adam_mini/qwen2_full_sft.yaml +40 -0
  17. InternVL/Qwen2.5-VL/LLaMA-Factory/examples/extras/apollo/llama3_full_sft.yaml +45 -0
  18. InternVL/Qwen2.5-VL/LLaMA-Factory/examples/extras/badam/llama3_full_sft.yaml +43 -0
  19. InternVL/Qwen2.5-VL/LLaMA-Factory/examples/extras/fsdp_qlora/llama3_lora_sft.yaml +42 -0
  20. InternVL/Qwen2.5-VL/LLaMA-Factory/examples/extras/fsdp_qlora/train.sh +6 -0
  21. InternVL/Qwen2.5-VL/LLaMA-Factory/examples/extras/galore/llama3_full_sft.yaml +44 -0
  22. InternVL/Qwen2.5-VL/LLaMA-Factory/examples/extras/llama_pro/expand.sh +6 -0
  23. InternVL/Qwen2.5-VL/LLaMA-Factory/examples/extras/llama_pro/llama3_freeze_sft.yaml +42 -0
  24. InternVL/Qwen2.5-VL/LLaMA-Factory/examples/extras/loraplus/llama3_lora_sft.yaml +42 -0
  25. InternVL/Qwen2.5-VL/LLaMA-Factory/examples/extras/mod/llama3_full_sft.yaml +41 -0
  26. InternVL/Qwen2.5-VL/LLaMA-Factory/examples/extras/nlg_eval/llama3_lora_predict.yaml +29 -0
  27. InternVL/Qwen2.5-VL/LLaMA-Factory/examples/extras/pissa/init.sh +5 -0
  28. InternVL/Qwen2.5-VL/LLaMA-Factory/examples/extras/pissa/llama3_lora_sft.yaml +44 -0
  29. InternVL/Qwen2.5-VL/LLaMA-Factory/examples/inference/.ipynb_checkpoints/qwen2_vl-checkpoint.yaml +4 -0
  30. InternVL/Qwen2.5-VL/LLaMA-Factory/examples/inference/llama3.yaml +4 -0
  31. InternVL/Qwen2.5-VL/LLaMA-Factory/examples/inference/llama3_full_sft.yaml +4 -0
  32. InternVL/Qwen2.5-VL/LLaMA-Factory/examples/inference/llama3_lora_sft.yaml +5 -0
  33. InternVL/Qwen2.5-VL/LLaMA-Factory/examples/inference/llama3_vllm.yaml +5 -0
  34. InternVL/Qwen2.5-VL/LLaMA-Factory/examples/inference/llava1_5.yaml +4 -0
  35. InternVL/Qwen2.5-VL/LLaMA-Factory/examples/inference/qwen2_vl.yaml +4 -0
  36. InternVL/Qwen2.5-VL/LLaMA-Factory/examples/train_full/llama3_full_sft.yaml +40 -0
  37. InternVL/Qwen2.5-VL/LLaMA-Factory/examples/train_full/qwen2vl_full_sft.yaml +45 -0
  38. InternVL/Qwen2.5-VL/LLaMA-Factory/examples/train_lora/.ipynb_checkpoints/qwen2vl_lora_sft-checkpoint.yaml +43 -0
  39. InternVL/Qwen2.5-VL/LLaMA-Factory/examples/train_lora/llama3_lora_dpo.yaml +43 -0
  40. InternVL/Qwen2.5-VL/LLaMA-Factory/examples/train_lora/llama3_lora_eval.yaml +19 -0
  41. InternVL/Qwen2.5-VL/LLaMA-Factory/examples/train_lora/llama3_lora_kto.yaml +42 -0
  42. InternVL/Qwen2.5-VL/LLaMA-Factory/examples/train_lora/llama3_lora_ppo.yaml +41 -0
  43. InternVL/Qwen2.5-VL/LLaMA-Factory/examples/train_lora/llama3_lora_pretrain.yaml +40 -0
  44. InternVL/Qwen2.5-VL/LLaMA-Factory/examples/train_lora/llama3_lora_reward.yaml +41 -0
  45. InternVL/Qwen2.5-VL/LLaMA-Factory/examples/train_lora/llama3_lora_sft.yaml +41 -0
  46. InternVL/Qwen2.5-VL/LLaMA-Factory/examples/train_lora/llama3_lora_sft_ds3.yaml +42 -0
  47. InternVL/Qwen2.5-VL/LLaMA-Factory/examples/train_lora/llama3_lora_sft_ray.yaml +49 -0
  48. InternVL/Qwen2.5-VL/LLaMA-Factory/examples/train_lora/llama3_preprocess.yaml +23 -0
  49. InternVL/Qwen2.5-VL/LLaMA-Factory/examples/train_lora/llava1_5_lora_sft.yaml +41 -0
  50. InternVL/Qwen2.5-VL/LLaMA-Factory/examples/train_lora/qwen2vl_lora_dpo.yaml +45 -0
InternVL/Qwen2.5-VL/LLaMA-Factory/.github/CODE_OF_CONDUCT.md ADDED
@@ -0,0 +1,128 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our
6
+ community a harassment-free experience for everyone, regardless of age, body
7
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
8
+ identity and expression, level of experience, education, socio-economic status,
9
+ nationality, personal appearance, race, religion, or sexual identity
10
+ and orientation.
11
+
12
+ We pledge to act and interact in ways that contribute to an open, welcoming,
13
+ diverse, inclusive, and healthy community.
14
+
15
+ ## Our Standards
16
+
17
+ Examples of behavior that contributes to a positive environment for our
18
+ community include:
19
+
20
+ * Demonstrating empathy and kindness toward other people
21
+ * Being respectful of differing opinions, viewpoints, and experiences
22
+ * Giving and gracefully accepting constructive feedback
23
+ * Accepting responsibility and apologizing to those affected by our mistakes,
24
+ and learning from the experience
25
+ * Focusing on what is best not just for us as individuals, but for the
26
+ overall community
27
+
28
+ Examples of unacceptable behavior include:
29
+
30
+ * The use of sexualized language or imagery, and sexual attention or
31
+ advances of any kind
32
+ * Trolling, insulting or derogatory comments, and personal or political attacks
33
+ * Public or private harassment
34
+ * Publishing others' private information, such as a physical or email
35
+ address, without their explicit permission
36
+ * Other conduct which could reasonably be considered inappropriate in a
37
+ professional setting
38
+
39
+ ## Enforcement Responsibilities
40
+
41
+ Community leaders are responsible for clarifying and enforcing our standards of
42
+ acceptable behavior and will take appropriate and fair corrective action in
43
+ response to any behavior that they deem inappropriate, threatening, offensive,
44
+ or harmful.
45
+
46
+ Community leaders have the right and responsibility to remove, edit, or reject
47
+ comments, commits, code, wiki edits, issues, and other contributions that are
48
+ not aligned to this Code of Conduct, and will communicate reasons for moderation
49
+ decisions when appropriate.
50
+
51
+ ## Scope
52
+
53
+ This Code of Conduct applies within all community spaces, and also applies when
54
+ an individual is officially representing the community in public spaces.
55
+ Examples of representing our community include using an official e-mail address,
56
+ posting via an official social media account, or acting as an appointed
57
+ representative at an online or offline event.
58
+
59
+ ## Enforcement
60
+
61
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
62
+ reported to the community leaders responsible for enforcement at
63
+ `hoshihiyouga AT gmail DOT com`.
64
+ All complaints will be reviewed and investigated promptly and fairly.
65
+
66
+ All community leaders are obligated to respect the privacy and security of the
67
+ reporter of any incident.
68
+
69
+ ## Enforcement Guidelines
70
+
71
+ Community leaders will follow these Community Impact Guidelines in determining
72
+ the consequences for any action they deem in violation of this Code of Conduct:
73
+
74
+ ### 1. Correction
75
+
76
+ **Community Impact**: Use of inappropriate language or other behavior deemed
77
+ unprofessional or unwelcome in the community.
78
+
79
+ **Consequence**: A private, written warning from community leaders, providing
80
+ clarity around the nature of the violation and an explanation of why the
81
+ behavior was inappropriate. A public apology may be requested.
82
+
83
+ ### 2. Warning
84
+
85
+ **Community Impact**: A violation through a single incident or series
86
+ of actions.
87
+
88
+ **Consequence**: A warning with consequences for continued behavior. No
89
+ interaction with the people involved, including unsolicited interaction with
90
+ those enforcing the Code of Conduct, for a specified period of time. This
91
+ includes avoiding interactions in community spaces as well as external channels
92
+ like social media. Violating these terms may lead to a temporary or
93
+ permanent ban.
94
+
95
+ ### 3. Temporary Ban
96
+
97
+ **Community Impact**: A serious violation of community standards, including
98
+ sustained inappropriate behavior.
99
+
100
+ **Consequence**: A temporary ban from any sort of interaction or public
101
+ communication with the community for a specified period of time. No public or
102
+ private interaction with the people involved, including unsolicited interaction
103
+ with those enforcing the Code of Conduct, is allowed during this period.
104
+ Violating these terms may lead to a permanent ban.
105
+
106
+ ### 4. Permanent Ban
107
+
108
+ **Community Impact**: Demonstrating a pattern of violation of community
109
+ standards, including sustained inappropriate behavior, harassment of an
110
+ individual, or aggression toward or disparagement of classes of individuals.
111
+
112
+ **Consequence**: A permanent ban from any sort of public interaction within
113
+ the community.
114
+
115
+ ## Attribution
116
+
117
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118
+ version 2.0, available at
119
+ https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
120
+
121
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct
122
+ enforcement ladder](https://github.com/mozilla/diversity).
123
+
124
+ [homepage]: https://www.contributor-covenant.org
125
+
126
+ For answers to common questions about this code of conduct, see the FAQ at
127
+ https://www.contributor-covenant.org/faq. Translations are available at
128
+ https://www.contributor-covenant.org/translations.
InternVL/Qwen2.5-VL/LLaMA-Factory/.github/CONTRIBUTING.md ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Contributing to LLaMA Factory
2
+
3
+ Everyone is welcome to contribute, and we value everybody's contribution. Code contributions are not the only way to help the community. Answering questions, helping others, and improving the documentation are also immensely valuable.
4
+
5
+ It also helps us if you spread the word! Reference the library in blog posts about the awesome projects it made possible, shout out on Twitter every time it has helped you, or simply ⭐️ the repository to say thank you.
6
+
7
+ However you choose to contribute, please be mindful and respect our [code of conduct](CODE_OF_CONDUCT.md).
8
+
9
+ **This guide was heavily inspired by [transformers guide to contributing](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md).**
10
+
11
+ ## Ways to contribute
12
+
13
+ There are several ways you can contribute to LLaMA Factory:
14
+
15
+ * Fix outstanding issues with the existing code.
16
+ * Submit issues related to bugs or desired new features.
17
+ * Contribute to the examples or to the documentation.
18
+
19
+ ### Style guide
20
+
21
+ LLaMA Factory follows the [Google Python Style Guide](https://google.github.io/styleguide/pyguide.html), check it for details.
22
+
23
+ ### Create a Pull Request
24
+
25
+ 1. Fork the [repository](https://github.com/hiyouga/LLaMA-Factory) by clicking on the [Fork](https://github.com/hiyouga/LLaMA-Factory/fork) button on the repository's page. This creates a copy of the code under your GitHub user account.
26
+
27
+ 2. Clone your fork to your local disk, and add the base repository as a remote:
28
+
29
+ ```bash
30
+ git clone git@github.com:[username]/LLaMA-Factory.git
31
+ cd LLaMA-Factory
32
+ git remote add upstream https://github.com/hiyouga/LLaMA-Factory.git
33
+ ```
34
+
35
+ 3. Create a new branch to hold your development changes:
36
+
37
+ ```bash
38
+ git checkout -b dev_your_branch
39
+ ```
40
+
41
+ 4. Set up a development environment by running the following command in a virtual environment:
42
+
43
+ ```bash
44
+ pip install -e ".[dev]"
45
+ ```
46
+
47
+ If LLaMA Factory was already installed in the virtual environment, remove it with `pip uninstall llamafactory` before reinstalling it in editable mode with the -e flag.
48
+
49
+ 5. Check code before commit:
50
+
51
+ ```bash
52
+ make commit
53
+ make style && make quality
54
+ make test
55
+ ```
56
+
57
+ 6. Submit changes:
58
+
59
+ ```bash
60
+ git add .
61
+ git commit -m "commit message"
62
+ git fetch upstream
63
+ git rebase upstream/main
64
+ git push -u origin dev_your_branch
65
+ ```
66
+
67
+ 7. Create a merge request from your branch `dev_your_branch` at [origin repo](https://github.com/hiyouga/LLaMA-Factory).
InternVL/Qwen2.5-VL/LLaMA-Factory/.github/ISSUE_TEMPLATE/1-bug-report.yml ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: "\U0001F41B Bug / help"
2
+ description: Create a report to help us improve the LLaMA Factory
3
+ labels: ["bug", "pending"]
4
+ body:
5
+ - type: markdown
6
+ attributes:
7
+ value: |
8
+ Issues included in **[FAQs](https://github.com/hiyouga/LLaMA-Factory/issues/4614)** or those with **insufficient** information may be closed without a response.
9
+ 已经包含在 **[常见问题](https://github.com/hiyouga/LLaMA-Factory/issues/4614)** 内或提供信息**不完整**的 issues 可能不会被回复。
10
+
11
+ - type: markdown
12
+ attributes:
13
+ value: |
14
+ Please do not create issues that are not related to framework bugs under this category, use **[Discussions](https://github.com/hiyouga/LLaMA-Factory/discussions/categories/q-a)** instead.
15
+ 请勿在此分类下创建和框架 bug 无关的 issues,请使用 **[讨论区](https://github.com/hiyouga/LLaMA-Factory/discussions/categories/q-a)**。
16
+
17
+ - type: checkboxes
18
+ id: reminder
19
+ attributes:
20
+ label: Reminder
21
+ description: |
22
+ Please ensure you have read the above rules carefully and searched the existing issues (including FAQs).
23
+ 请确保您已经认真阅读了上述规则并且搜索过现有的 issues(包括常见问题)。
24
+
25
+ options:
26
+ - label: I have read the above rules and searched the existing issues.
27
+ required: true
28
+
29
+ - type: textarea
30
+ id: system-info
31
+ validations:
32
+ required: true
33
+ attributes:
34
+ label: System Info
35
+ description: |
36
+ Please share your system info with us. You can run the command **llamafactory-cli env** and copy-paste its output below.
37
+ 请提供您的系统信息。您可以在命令行运行 **llamafactory-cli env** 并将其输出复制到该文本框中。
38
+
39
+ placeholder: llamafactory version, platform, python version, ...
40
+
41
+ - type: textarea
42
+ id: reproduction
43
+ validations:
44
+ required: true
45
+ attributes:
46
+ label: Reproduction
47
+ description: |
48
+ Please provide entry arguments, error messages and stack traces that reproduces the problem.
49
+ 请提供入口参数,错误日志以及异常堆栈以便于我们复现问题。
50
+ Remember to wrap your log messages with \`\`\`.
51
+ 请务必使用 Markdown 标签 \`\`\` 来包裹您的日志信息。
52
+
53
+ value: |
54
+ ```text
55
+ Put your message here.
56
+ ```
57
+
58
+ - type: textarea
59
+ id: others
60
+ validations:
61
+ required: false
62
+ attributes:
63
+ label: Others
InternVL/Qwen2.5-VL/LLaMA-Factory/.github/ISSUE_TEMPLATE/2-feature-request.yml ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: "\U0001F680 Feature request"
2
+ description: Submit a request for a new feature
3
+ labels: ["enhancement", "pending"]
4
+ body:
5
+ - type: markdown
6
+ attributes:
7
+ value: |
8
+ Please do not create issues that are not related to new features under this category.
9
+ 请勿在此分类下创建和新特性无关的 issues。
10
+
11
+ - type: checkboxes
12
+ id: reminder
13
+ attributes:
14
+ label: Reminder
15
+ description: |
16
+ Please ensure you have read the above rules carefully and searched the existing issues.
17
+ 请确保您已经认真阅读了上述规则并且搜索过现有的 issues。
18
+
19
+ options:
20
+ - label: I have read the above rules and searched the existing issues.
21
+ required: true
22
+
23
+ - type: textarea
24
+ id: description
25
+ validations:
26
+ required: true
27
+ attributes:
28
+ label: Description
29
+ description: |
30
+ A clear and concise description of the feature proposal.
31
+ 请详细描述您希望加入的新功能特性。
32
+
33
+ - type: textarea
34
+ id: contribution
35
+ validations:
36
+ required: false
37
+ attributes:
38
+ label: Pull Request
39
+ description: |
40
+ Have you already created the relevant PR and submitted the code?
41
+ 您是否已经创建了相关 PR 并提交了代码?
InternVL/Qwen2.5-VL/LLaMA-Factory/.github/ISSUE_TEMPLATE/config.yml ADDED
@@ -0,0 +1 @@
 
 
1
+ blank_issues_enabled: false
InternVL/Qwen2.5-VL/LLaMA-Factory/.github/PULL_REQUEST_TEMPLATE.md ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ # What does this PR do?
2
+
3
+ Fixes # (issue)
4
+
5
+ ## Before submitting
6
+
7
+ - [ ] Did you read the [contributor guideline](https://github.com/hiyouga/LLaMA-Factory/blob/main/.github/CONTRIBUTING.md)?
8
+ - [ ] Did you write any new necessary tests?
InternVL/Qwen2.5-VL/LLaMA-Factory/.github/SECURITY.md ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ # Reporting Security Issues
2
+
3
+ To report a security issue, please use the GitHub Security Advisory ["Report a Vulnerability"](https://github.com/hiyouga/LLaMA-Factory/security/advisories/new) tab.
4
+
5
+ We will send a response indicating the next steps in handling your report. After the initial reply to your report, the security team will keep you informed of the progress towards a fix and full announcement, and may ask for additional information or guidance.
6
+
7
+ Report security bugs in third-party modules to the person or team maintaining the module.
InternVL/Qwen2.5-VL/LLaMA-Factory/.github/workflows/label_issue.yml ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: label_issue
2
+
3
+ on:
4
+ issues:
5
+ types:
6
+ - opened
7
+
8
+ jobs:
9
+ label_issue:
10
+ runs-on: ubuntu-latest
11
+
12
+ permissions:
13
+ issues: write
14
+
15
+ steps:
16
+ - env:
17
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18
+ ISSUE_URL: ${{ github.event.issue.html_url }}
19
+ ISSUE_TITLE: ${{ github.event.issue.title }}
20
+ run: |
21
+ LABEL=""
22
+ NPU_KEYWORDS=(npu huawei ascend 华为 昇腾)
23
+ ISSUE_TITLE_LOWER=$(echo $ISSUE_TITLE | tr '[:upper:]' '[:lower:]')
24
+ for KEYWORD in ${NPU_KEYWORDS[@]}; do
25
+ if [[ $ISSUE_TITLE_LOWER == *$KEYWORD* ]] && [[ $ISSUE_TITLE_LOWER != *input* ]]; then
26
+ LABEL="npu"
27
+ break
28
+ fi
29
+ done
30
+ if [ -n "$LABEL" ]; then
31
+ gh issue edit $ISSUE_URL --add-label $LABEL
32
+ fi
InternVL/Qwen2.5-VL/LLaMA-Factory/.github/workflows/publish.yml ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: publish
2
+
3
+ on:
4
+ release:
5
+ types:
6
+ - published
7
+
8
+ jobs:
9
+ publish:
10
+ name: Upload release to PyPI
11
+
12
+ runs-on: ubuntu-latest
13
+
14
+ environment:
15
+ name: release
16
+ url: https://pypi.org/p/llamafactory
17
+
18
+ permissions:
19
+ id-token: write
20
+
21
+ steps:
22
+ - name: Checkout
23
+ uses: actions/checkout@v4
24
+
25
+ - name: Set up Python
26
+ uses: actions/setup-python@v5
27
+ with:
28
+ python-version: "3.9"
29
+
30
+ - name: Install dependencies
31
+ run: |
32
+ python -m pip install --upgrade pip
33
+ python -m pip install build
34
+
35
+ - name: Build package
36
+ run: |
37
+ python -m build
38
+
39
+ - name: Publish package
40
+ uses: pypa/gh-action-pypi-publish@release/v1
InternVL/Qwen2.5-VL/LLaMA-Factory/.github/workflows/tests.yml ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: tests
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - "main"
7
+ paths:
8
+ - "**.py"
9
+ - "requirements.txt"
10
+ - ".github/workflows/*.yml"
11
+ pull_request:
12
+ branches:
13
+ - "main"
14
+ paths:
15
+ - "**.py"
16
+ - "requirements.txt"
17
+ - ".github/workflows/*.yml"
18
+
19
+ jobs:
20
+ tests:
21
+ strategy:
22
+ fail-fast: false
23
+ matrix:
24
+ python-version:
25
+ - "3.9"
26
+ - "3.10"
27
+ - "3.11"
28
+ - "3.12"
29
+ os:
30
+ - "ubuntu-latest"
31
+ - "windows-latest"
32
+ - "macos-13"
33
+
34
+ runs-on: ${{ matrix.os }}
35
+
36
+ env:
37
+ HF_TOKEN: ${{ secrets.HF_TOKEN }}
38
+ OS_NAME: ${{ matrix.os }}
39
+
40
+ steps:
41
+ - name: Checkout
42
+ uses: actions/checkout@v4
43
+
44
+ - name: Set up Python
45
+ uses: actions/setup-python@v5
46
+ with:
47
+ python-version: ${{ matrix.python-version }}
48
+ cache: "pip"
49
+ cache-dependency-path: "setup.py"
50
+
51
+ - name: Install dependencies
52
+ run: |
53
+ python -m pip install --upgrade pip
54
+ python -m pip install ".[torch,dev]"
55
+
56
+ - name: Check quality
57
+ run: |
58
+ make style && make quality
59
+
60
+ - name: Test with pytest
61
+ run: |
62
+ make test
InternVL/Qwen2.5-VL/LLaMA-Factory/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": true,
23
+ "reduce_scatter": true,
24
+ "reduce_bucket_size": 5e8,
25
+ "contiguous_gradients": true,
26
+ "round_robin_gradients": true
27
+ }
28
+ }
InternVL/Qwen2.5-VL/LLaMA-Factory/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": true,
23
+ "reduce_scatter": true,
24
+ "reduce_bucket_size": 5e8,
25
+ "contiguous_gradients": true,
26
+ "round_robin_gradients": true
27
+ }
28
+ }
InternVL/Qwen2.5-VL/LLaMA-Factory/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": true,
27
+ "reduce_scatter": true,
28
+ "reduce_bucket_size": 5e8,
29
+ "contiguous_gradients": true,
30
+ "round_robin_gradients": true
31
+ }
32
+ }
InternVL/Qwen2.5-VL/LLaMA-Factory/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": true,
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
+ }
InternVL/Qwen2.5-VL/LLaMA-Factory/examples/deepspeed/ds_z3_offload_config.json ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ "offload_optimizer": {
21
+ "device": "cpu",
22
+ "pin_memory": true
23
+ },
24
+ "offload_param": {
25
+ "device": "cpu",
26
+ "pin_memory": true
27
+ },
28
+ "overlap_comm": true,
29
+ "contiguous_gradients": true,
30
+ "sub_group_size": 1e9,
31
+ "reduce_bucket_size": "auto",
32
+ "stage3_prefetch_bucket_size": "auto",
33
+ "stage3_param_persistence_threshold": "auto",
34
+ "stage3_max_live_parameters": 1e9,
35
+ "stage3_max_reuse_distance": 1e9,
36
+ "stage3_gather_16bit_weights_on_model_save": true
37
+ }
38
+ }
InternVL/Qwen2.5-VL/LLaMA-Factory/examples/extras/adam_mini/qwen2_full_sft.yaml ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### model
2
+ model_name_or_path: Qwen/Qwen2-1.5B-Instruct
3
+ trust_remote_code: true
4
+
5
+ ### method
6
+ stage: sft
7
+ do_train: true
8
+ finetuning_type: full
9
+ use_adam_mini: true
10
+
11
+ ### dataset
12
+ dataset: identity,alpaca_en_demo
13
+ template: qwen
14
+ cutoff_len: 2048
15
+ max_samples: 1000
16
+ overwrite_cache: true
17
+ preprocessing_num_workers: 16
18
+
19
+ ### output
20
+ output_dir: saves/qwen2-1_5b/full/sft
21
+ logging_steps: 10
22
+ save_steps: 500
23
+ plot_loss: true
24
+ overwrite_output_dir: true
25
+
26
+ ### train
27
+ per_device_train_batch_size: 1
28
+ gradient_accumulation_steps: 8
29
+ learning_rate: 1.0e-5
30
+ num_train_epochs: 3.0
31
+ lr_scheduler_type: cosine
32
+ warmup_ratio: 0.1
33
+ bf16: true
34
+ ddp_timeout: 180000000
35
+
36
+ ### eval
37
+ # val_size: 0.1
38
+ # per_device_eval_batch_size: 1
39
+ # eval_strategy: steps
40
+ # eval_steps: 500
InternVL/Qwen2.5-VL/LLaMA-Factory/examples/extras/apollo/llama3_full_sft.yaml ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### model
2
+ model_name_or_path: meta-llama/Meta-Llama-3-8B-Instruct
3
+ trust_remote_code: true
4
+
5
+ ### method
6
+ stage: sft
7
+ do_train: true
8
+ finetuning_type: full
9
+ use_apollo: true
10
+ apollo_layerwise: true # choices: [true, false], use false for DDP training
11
+ apollo_target: all
12
+ apollo_rank: 128
13
+ apollo_scale: 32.0
14
+ apollo_scale_type: channel
15
+
16
+ ### dataset
17
+ dataset: identity,alpaca_en_demo
18
+ template: llama3
19
+ cutoff_len: 2048
20
+ max_samples: 1000
21
+ overwrite_cache: true
22
+ preprocessing_num_workers: 16
23
+
24
+ ### output
25
+ output_dir: saves/llama3-8b/full/sft
26
+ logging_steps: 10
27
+ save_steps: 500
28
+ plot_loss: true
29
+ overwrite_output_dir: true
30
+
31
+ ### train
32
+ per_device_train_batch_size: 1
33
+ gradient_accumulation_steps: 1 # use 1 for layerwise apollo
34
+ learning_rate: 1.0e-5
35
+ num_train_epochs: 3.0
36
+ lr_scheduler_type: cosine
37
+ warmup_ratio: 0.1
38
+ pure_bf16: true
39
+ ddp_timeout: 180000000
40
+
41
+ ### eval
42
+ # val_size: 0.1
43
+ # per_device_eval_batch_size: 1
44
+ # eval_strategy: steps
45
+ # eval_steps: 500
InternVL/Qwen2.5-VL/LLaMA-Factory/examples/extras/badam/llama3_full_sft.yaml ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### model
2
+ model_name_or_path: meta-llama/Meta-Llama-3-8B-Instruct
3
+ trust_remote_code: true
4
+
5
+ ### method
6
+ stage: sft
7
+ do_train: true
8
+ finetuning_type: full
9
+ use_badam: true
10
+ badam_mode: layer
11
+ badam_switch_mode: ascending
12
+ badam_switch_interval: 50
13
+ badam_verbose: 2
14
+ # deepspeed: examples/deepspeed/ds_z3_config.json
15
+
16
+ ### dataset
17
+ dataset: identity,alpaca_en_demo
18
+ template: llama3
19
+ cutoff_len: 2048
20
+ max_samples: 1000
21
+ overwrite_cache: true
22
+ preprocessing_num_workers: 16
23
+
24
+ ### output
25
+ output_dir: saves/llama3-8b/full/sft
26
+ logging_steps: 10
27
+ save_steps: 500
28
+ plot_loss: true
29
+ overwrite_output_dir: true
30
+
31
+ ### train
32
+ per_device_train_batch_size: 1
33
+ gradient_accumulation_steps: 8
34
+ learning_rate: 1.0e-5
35
+ num_train_epochs: 3.0
36
+ lr_scheduler_type: cosine
37
+ warmup_ratio: 0.1
38
+
39
+ ### eval
40
+ # val_size: 0.1
41
+ # per_device_eval_batch_size: 1
42
+ # eval_strategy: steps
43
+ # eval_steps: 500
InternVL/Qwen2.5-VL/LLaMA-Factory/examples/extras/fsdp_qlora/llama3_lora_sft.yaml ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### model
2
+ model_name_or_path: meta-llama/Meta-Llama-3-8B-Instruct
3
+ quantization_bit: 4
4
+ trust_remote_code: true
5
+
6
+ ### method
7
+ stage: sft
8
+ do_train: true
9
+ finetuning_type: lora
10
+ lora_rank: 8
11
+ lora_target: all
12
+
13
+ ### dataset
14
+ dataset: identity,alpaca_en_demo
15
+ template: llama3
16
+ cutoff_len: 2048
17
+ max_samples: 1000
18
+ overwrite_cache: true
19
+ preprocessing_num_workers: 16
20
+
21
+ ### output
22
+ output_dir: saves/llama3-8b/lora/sft
23
+ logging_steps: 10
24
+ save_steps: 500
25
+ plot_loss: true
26
+ overwrite_output_dir: true
27
+
28
+ ### train
29
+ per_device_train_batch_size: 1
30
+ gradient_accumulation_steps: 8
31
+ learning_rate: 1.0e-4
32
+ num_train_epochs: 3.0
33
+ lr_scheduler_type: cosine
34
+ warmup_ratio: 0.1
35
+ bf16: true
36
+ ddp_timeout: 180000000
37
+
38
+ ### eval
39
+ # val_size: 0.1
40
+ # per_device_eval_batch_size: 1
41
+ # eval_strategy: steps
42
+ # eval_steps: 500
InternVL/Qwen2.5-VL/LLaMA-Factory/examples/extras/fsdp_qlora/train.sh ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+ # DO NOT use GPTQ/AWQ model in FSDP+QLoRA
3
+
4
+ CUDA_VISIBLE_DEVICES=0,1 accelerate launch \
5
+ --config_file examples/accelerate/fsdp_config.yaml \
6
+ src/train.py examples/extras/fsdp_qlora/llama3_lora_sft.yaml
InternVL/Qwen2.5-VL/LLaMA-Factory/examples/extras/galore/llama3_full_sft.yaml ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### model
2
+ model_name_or_path: meta-llama/Meta-Llama-3-8B-Instruct
3
+ trust_remote_code: true
4
+
5
+ ### method
6
+ stage: sft
7
+ do_train: true
8
+ finetuning_type: full
9
+ use_galore: true
10
+ galore_layerwise: true # choices: [true, false], use false for DDP training
11
+ galore_target: all
12
+ galore_rank: 128
13
+ galore_scale: 2.0
14
+
15
+ ### dataset
16
+ dataset: identity,alpaca_en_demo
17
+ template: llama3
18
+ cutoff_len: 2048
19
+ max_samples: 1000
20
+ overwrite_cache: true
21
+ preprocessing_num_workers: 16
22
+
23
+ ### output
24
+ output_dir: saves/llama3-8b/full/sft
25
+ logging_steps: 10
26
+ save_steps: 500
27
+ plot_loss: true
28
+ overwrite_output_dir: true
29
+
30
+ ### train
31
+ per_device_train_batch_size: 1
32
+ gradient_accumulation_steps: 1 # use 1 for layerwise galore
33
+ learning_rate: 1.0e-5
34
+ num_train_epochs: 3.0
35
+ lr_scheduler_type: cosine
36
+ warmup_ratio: 0.1
37
+ pure_bf16: true
38
+ ddp_timeout: 180000000
39
+
40
+ ### eval
41
+ # val_size: 0.1
42
+ # per_device_eval_batch_size: 1
43
+ # eval_strategy: steps
44
+ # eval_steps: 500
InternVL/Qwen2.5-VL/LLaMA-Factory/examples/extras/llama_pro/expand.sh ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ python scripts/llama_pro.py \
4
+ --model_name_or_path meta-llama/Meta-Llama-3-8B-Instruct \
5
+ --output_dir models/llama3-8b-pro \
6
+ --num_expand 8
InternVL/Qwen2.5-VL/LLaMA-Factory/examples/extras/llama_pro/llama3_freeze_sft.yaml ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### model
2
+ model_name_or_path: models/llama3-8b-pro
3
+ trust_remote_code: true
4
+
5
+ ### method
6
+ stage: sft
7
+ do_train: true
8
+ finetuning_type: freeze
9
+ freeze_trainable_layers: 8
10
+ freeze_trainable_modules: all
11
+ use_llama_pro: true
12
+
13
+ ### dataset
14
+ dataset: identity,alpaca_en_demo
15
+ template: llama3
16
+ cutoff_len: 2048
17
+ max_samples: 1000
18
+ overwrite_cache: true
19
+ preprocessing_num_workers: 16
20
+
21
+ ### output
22
+ output_dir: saves/llama3-8b-pro/freeze/sft
23
+ logging_steps: 10
24
+ save_steps: 500
25
+ plot_loss: true
26
+ overwrite_output_dir: true
27
+
28
+ ### train
29
+ per_device_train_batch_size: 1
30
+ gradient_accumulation_steps: 8
31
+ learning_rate: 1.0e-4
32
+ num_train_epochs: 3.0
33
+ lr_scheduler_type: cosine
34
+ warmup_ratio: 0.1
35
+ bf16: true
36
+ ddp_timeout: 180000000
37
+
38
+ ### eval
39
+ # val_size: 0.1
40
+ # per_device_eval_batch_size: 1
41
+ # eval_strategy: steps
42
+ # eval_steps: 500
InternVL/Qwen2.5-VL/LLaMA-Factory/examples/extras/loraplus/llama3_lora_sft.yaml ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### model
2
+ model_name_or_path: meta-llama/Meta-Llama-3-8B-Instruct
3
+ trust_remote_code: true
4
+
5
+ ### method
6
+ stage: sft
7
+ do_train: true
8
+ finetuning_type: lora
9
+ lora_rank: 8
10
+ lora_target: all
11
+ loraplus_lr_ratio: 16.0
12
+
13
+ ### dataset
14
+ dataset: identity,alpaca_en_demo
15
+ template: llama3
16
+ cutoff_len: 2048
17
+ max_samples: 1000
18
+ overwrite_cache: true
19
+ preprocessing_num_workers: 16
20
+
21
+ ### output
22
+ output_dir: saves/llama3-8b/lora/sft
23
+ logging_steps: 10
24
+ save_steps: 500
25
+ plot_loss: true
26
+ overwrite_output_dir: true
27
+
28
+ ### train
29
+ per_device_train_batch_size: 1
30
+ gradient_accumulation_steps: 8
31
+ learning_rate: 1.0e-4
32
+ num_train_epochs: 3.0
33
+ lr_scheduler_type: cosine
34
+ warmup_ratio: 0.1
35
+ bf16: true
36
+ ddp_timeout: 180000000
37
+
38
+ ### eval
39
+ # val_size: 0.1
40
+ # per_device_eval_batch_size: 1
41
+ # eval_strategy: steps
42
+ # eval_steps: 500
InternVL/Qwen2.5-VL/LLaMA-Factory/examples/extras/mod/llama3_full_sft.yaml ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### model
2
+ model_name_or_path: meta-llama/Meta-Llama-3-8B-Instruct
3
+ trust_remote_code: true
4
+
5
+ ### method
6
+ stage: sft
7
+ do_train: true
8
+ finetuning_type: full
9
+ mixture_of_depths: convert
10
+
11
+ ### dataset
12
+ dataset: identity,alpaca_en_demo
13
+ template: llama3
14
+ cutoff_len: 2048
15
+ max_samples: 1000
16
+ overwrite_cache: true
17
+ preprocessing_num_workers: 16
18
+
19
+ ### output
20
+ output_dir: saves/llama3-8b-mod/full/sft
21
+ logging_steps: 10
22
+ save_steps: 500
23
+ plot_loss: true
24
+ overwrite_output_dir: true
25
+
26
+ ### train
27
+ per_device_train_batch_size: 1
28
+ gradient_accumulation_steps: 8
29
+ optim: paged_adamw_8bit
30
+ learning_rate: 1.0e-5
31
+ num_train_epochs: 3.0
32
+ lr_scheduler_type: cosine
33
+ warmup_ratio: 0.1
34
+ pure_bf16: true
35
+ ddp_timeout: 180000000
36
+
37
+ ### eval
38
+ # val_size: 0.1
39
+ # per_device_eval_batch_size: 1
40
+ # eval_strategy: steps
41
+ # eval_steps: 500
InternVL/Qwen2.5-VL/LLaMA-Factory/examples/extras/nlg_eval/llama3_lora_predict.yaml ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # The batch generation can be SLOW using this config.
2
+ # For faster inference, we recommend to use `scripts/vllm_infer.py`.
3
+
4
+ ### model
5
+ model_name_or_path: meta-llama/Meta-Llama-3-8B-Instruct
6
+ adapter_name_or_path: saves/llama3-8b/lora/sft
7
+ trust_remote_code: true
8
+
9
+ ### method
10
+ stage: sft
11
+ do_predict: true
12
+ finetuning_type: lora
13
+
14
+ ### dataset
15
+ eval_dataset: identity,alpaca_en_demo
16
+ template: llama3
17
+ cutoff_len: 2048
18
+ max_samples: 50
19
+ overwrite_cache: true
20
+ preprocessing_num_workers: 16
21
+
22
+ ### output
23
+ output_dir: saves/llama3-8b/lora/predict
24
+ overwrite_output_dir: true
25
+
26
+ ### eval
27
+ per_device_eval_batch_size: 1
28
+ predict_with_generate: true
29
+ ddp_timeout: 180000000
InternVL/Qwen2.5-VL/LLaMA-Factory/examples/extras/pissa/init.sh ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ python scripts/pissa_init.py \
4
+ --model_name_or_path meta-llama/Meta-Llama-3-8B-Instruct \
5
+ --output_dir models/llama3-8b-pissa
InternVL/Qwen2.5-VL/LLaMA-Factory/examples/extras/pissa/llama3_lora_sft.yaml ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### model
2
+ model_name_or_path: meta-llama/Meta-Llama-3-8B-Instruct
3
+ trust_remote_code: true
4
+
5
+ ### method
6
+ stage: sft
7
+ do_train: true
8
+ finetuning_type: lora
9
+ lora_rank: 8
10
+ lora_target: all
11
+ pissa_init: true
12
+ pissa_iter: 16
13
+ pissa_convert: true
14
+
15
+ ### dataset
16
+ dataset: identity,alpaca_en_demo
17
+ template: llama3
18
+ cutoff_len: 2048
19
+ max_samples: 1000
20
+ overwrite_cache: true
21
+ preprocessing_num_workers: 16
22
+
23
+ ### output
24
+ output_dir: saves/llama3-8b/lora/sft
25
+ logging_steps: 10
26
+ save_steps: 500
27
+ plot_loss: true
28
+ overwrite_output_dir: true
29
+
30
+ ### train
31
+ per_device_train_batch_size: 1
32
+ gradient_accumulation_steps: 8
33
+ learning_rate: 1.0e-4
34
+ num_train_epochs: 3.0
35
+ lr_scheduler_type: cosine
36
+ warmup_ratio: 0.1
37
+ bf16: true
38
+ ddp_timeout: 180000000
39
+
40
+ ### eval
41
+ # val_size: 0.1
42
+ # per_device_eval_batch_size: 1
43
+ # eval_strategy: steps
44
+ # eval_steps: 500
InternVL/Qwen2.5-VL/LLaMA-Factory/examples/inference/.ipynb_checkpoints/qwen2_vl-checkpoint.yaml ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ model_name_or_path: ../saves/qwen2_vl-7b/lora/sft
2
+ template: qwen2_vl
3
+ infer_backend: huggingface # choices: [huggingface, vllm]
4
+ trust_remote_code: true
InternVL/Qwen2.5-VL/LLaMA-Factory/examples/inference/llama3.yaml ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ model_name_or_path: meta-llama/Meta-Llama-3-8B-Instruct
2
+ template: llama3
3
+ infer_backend: huggingface # choices: [huggingface, vllm]
4
+ trust_remote_code: true
InternVL/Qwen2.5-VL/LLaMA-Factory/examples/inference/llama3_full_sft.yaml ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ model_name_or_path: saves/llama3-8b/full/sft
2
+ template: llama3
3
+ infer_backend: huggingface # choices: [huggingface, vllm]
4
+ trust_remote_code: true
InternVL/Qwen2.5-VL/LLaMA-Factory/examples/inference/llama3_lora_sft.yaml ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ model_name_or_path: meta-llama/Meta-Llama-3-8B-Instruct
2
+ adapter_name_or_path: saves/llama3-8b/lora/sft
3
+ template: llama3
4
+ infer_backend: huggingface # choices: [huggingface, vllm]
5
+ trust_remote_code: true
InternVL/Qwen2.5-VL/LLaMA-Factory/examples/inference/llama3_vllm.yaml ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ model_name_or_path: meta-llama/Meta-Llama-3-8B-Instruct
2
+ template: llama3
3
+ infer_backend: vllm
4
+ vllm_enforce_eager: true
5
+ trust_remote_code: true
InternVL/Qwen2.5-VL/LLaMA-Factory/examples/inference/llava1_5.yaml ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ model_name_or_path: llava-hf/llava-1.5-7b-hf
2
+ template: llava
3
+ infer_backend: huggingface # choices: [huggingface, vllm]
4
+ trust_remote_code: true
InternVL/Qwen2.5-VL/LLaMA-Factory/examples/inference/qwen2_vl.yaml ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ model_name_or_path: ../saves/qwen2_vl-7b/lora/sft
2
+ template: qwen2_vl
3
+ infer_backend: huggingface # choices: [huggingface, vllm]
4
+ trust_remote_code: true
InternVL/Qwen2.5-VL/LLaMA-Factory/examples/train_full/llama3_full_sft.yaml ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### model
2
+ model_name_or_path: meta-llama/Meta-Llama-3-8B-Instruct
3
+ trust_remote_code: true
4
+
5
+ ### method
6
+ stage: sft
7
+ do_train: true
8
+ finetuning_type: full
9
+ deepspeed: examples/deepspeed/ds_z3_config.json # choices: [ds_z0_config.json, ds_z2_config.json, ds_z3_config.json]
10
+
11
+ ### dataset
12
+ dataset: identity,alpaca_en_demo
13
+ template: llama3
14
+ cutoff_len: 2048
15
+ max_samples: 1000
16
+ overwrite_cache: true
17
+ preprocessing_num_workers: 16
18
+
19
+ ### output
20
+ output_dir: saves/llama3-8b/full/sft
21
+ logging_steps: 10
22
+ save_steps: 500
23
+ plot_loss: true
24
+ overwrite_output_dir: true
25
+
26
+ ### train
27
+ per_device_train_batch_size: 1
28
+ gradient_accumulation_steps: 2
29
+ learning_rate: 1.0e-5
30
+ num_train_epochs: 3.0
31
+ lr_scheduler_type: cosine
32
+ warmup_ratio: 0.1
33
+ bf16: true
34
+ ddp_timeout: 180000000
35
+
36
+ ### eval
37
+ # val_size: 0.1
38
+ # per_device_eval_batch_size: 1
39
+ # eval_strategy: steps
40
+ # eval_steps: 500
InternVL/Qwen2.5-VL/LLaMA-Factory/examples/train_full/qwen2vl_full_sft.yaml ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### model
2
+ model_name_or_path: Qwen/Qwen2-VL-7B-Instruct
3
+ image_max_pixels: 262144
4
+ video_max_pixels: 16384
5
+ trust_remote_code: true
6
+
7
+ ### method
8
+ stage: sft
9
+ do_train: true
10
+ finetuning_type: full
11
+ freeze_vision_tower: true # choices: [true, false]
12
+ freeze_multi_modal_projector: true # choices: [true, false]
13
+ train_mm_proj_only: false # choices: [true, false]
14
+ deepspeed: examples/deepspeed/ds_z3_config.json # choices: [ds_z0_config.json, ds_z2_config.json, ds_z3_config.json]
15
+
16
+ ### dataset
17
+ dataset: mllm_demo,identity,alpaca_en_demo
18
+ template: qwen2_vl
19
+ cutoff_len: 2048
20
+ max_samples: 1000
21
+ overwrite_cache: true
22
+ preprocessing_num_workers: 16
23
+
24
+ ### output
25
+ output_dir: saves/qwen2_vl-7b/full/sft
26
+ logging_steps: 10
27
+ save_steps: 500
28
+ plot_loss: true
29
+ overwrite_output_dir: true
30
+
31
+ ### train
32
+ per_device_train_batch_size: 1
33
+ gradient_accumulation_steps: 2
34
+ learning_rate: 1.0e-5
35
+ num_train_epochs: 3.0
36
+ lr_scheduler_type: cosine
37
+ warmup_ratio: 0.1
38
+ bf16: true
39
+ ddp_timeout: 180000000
40
+
41
+ ### eval
42
+ # val_size: 0.1
43
+ # per_device_eval_batch_size: 1
44
+ # eval_strategy: steps
45
+ # eval_steps: 500
InternVL/Qwen2.5-VL/LLaMA-Factory/examples/train_lora/.ipynb_checkpoints/qwen2vl_lora_sft-checkpoint.yaml ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### model
2
+ model_name_or_path: ../Qwen/Qwen2-VL-7B
3
+ image_max_pixels: 262144
4
+ video_max_pixels: 16384
5
+ trust_remote_code: true
6
+
7
+ ### method
8
+ stage: sft
9
+ do_train: true
10
+ finetuning_type: lora
11
+ lora_rank: 8
12
+ lora_target: all
13
+
14
+ ### dataset
15
+ dataset: samples_120
16
+ template: qwen2_vl
17
+ cutoff_len: 4096
18
+ max_samples: 1000
19
+ overwrite_cache: true
20
+ preprocessing_num_workers: 16
21
+
22
+ ### output
23
+ output_dir: ../finetune_checkpoints/qwen2_vl-7b_lora_sft_checkpoint
24
+ logging_steps: 10
25
+ save_steps: 500
26
+ plot_loss: true
27
+ overwrite_output_dir: true
28
+
29
+ ### train
30
+ per_device_train_batch_size: 1
31
+ gradient_accumulation_steps: 8
32
+ learning_rate: 1.0e-4
33
+ num_train_epochs: 3.0
34
+ lr_scheduler_type: cosine
35
+ warmup_ratio: 0.1
36
+ bf16: true
37
+ ddp_timeout: 180000000
38
+
39
+ ### eval
40
+ # val_size: 0.1
41
+ # per_device_eval_batch_size: 1
42
+ # eval_strategy: steps
43
+ # eval_steps: 500
InternVL/Qwen2.5-VL/LLaMA-Factory/examples/train_lora/llama3_lora_dpo.yaml ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### model
2
+ model_name_or_path: meta-llama/Meta-Llama-3-8B-Instruct
3
+ trust_remote_code: true
4
+
5
+ ### method
6
+ stage: dpo
7
+ do_train: true
8
+ finetuning_type: lora
9
+ lora_rank: 8
10
+ lora_target: all
11
+ pref_beta: 0.1
12
+ pref_loss: sigmoid # choices: [sigmoid (dpo), orpo, simpo]
13
+
14
+ ### dataset
15
+ dataset: dpo_en_demo
16
+ template: llama3
17
+ cutoff_len: 2048
18
+ max_samples: 1000
19
+ overwrite_cache: true
20
+ preprocessing_num_workers: 16
21
+
22
+ ### output
23
+ output_dir: saves/llama3-8b/lora/dpo
24
+ logging_steps: 10
25
+ save_steps: 500
26
+ plot_loss: true
27
+ overwrite_output_dir: true
28
+
29
+ ### train
30
+ per_device_train_batch_size: 1
31
+ gradient_accumulation_steps: 8
32
+ learning_rate: 5.0e-6
33
+ num_train_epochs: 3.0
34
+ lr_scheduler_type: cosine
35
+ warmup_ratio: 0.1
36
+ bf16: true
37
+ ddp_timeout: 180000000
38
+
39
+ ### eval
40
+ # val_size: 0.1
41
+ # per_device_eval_batch_size: 1
42
+ # eval_strategy: steps
43
+ # eval_steps: 500
InternVL/Qwen2.5-VL/LLaMA-Factory/examples/train_lora/llama3_lora_eval.yaml ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### model
2
+ model_name_or_path: meta-llama/Meta-Llama-3-8B-Instruct
3
+ adapter_name_or_path: saves/llama3-8b/lora/sft
4
+ trust_remote_code: true
5
+
6
+ ### method
7
+ finetuning_type: lora
8
+
9
+ ### dataset
10
+ task: mmlu_test # choices: [mmlu_test, ceval_validation, cmmlu_test]
11
+ template: fewshot
12
+ lang: en
13
+ n_shot: 5
14
+
15
+ ### output
16
+ save_dir: saves/llama3-8b/lora/eval
17
+
18
+ ### eval
19
+ batch_size: 4
InternVL/Qwen2.5-VL/LLaMA-Factory/examples/train_lora/llama3_lora_kto.yaml ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### model
2
+ model_name_or_path: meta-llama/Meta-Llama-3-8B-Instruct
3
+ trust_remote_code: true
4
+
5
+ ### method
6
+ stage: kto
7
+ do_train: true
8
+ finetuning_type: lora
9
+ lora_rank: 8
10
+ lora_target: all
11
+ pref_beta: 0.1
12
+
13
+ ### dataset
14
+ dataset: kto_en_demo
15
+ template: llama3
16
+ cutoff_len: 2048
17
+ max_samples: 1000
18
+ overwrite_cache: true
19
+ preprocessing_num_workers: 16
20
+
21
+ ### output
22
+ output_dir: saves/llama3-8b/lora/kto
23
+ logging_steps: 10
24
+ save_steps: 500
25
+ plot_loss: true
26
+ overwrite_output_dir: true
27
+
28
+ ### train
29
+ per_device_train_batch_size: 1
30
+ gradient_accumulation_steps: 8
31
+ learning_rate: 5.0e-6
32
+ num_train_epochs: 3.0
33
+ lr_scheduler_type: cosine
34
+ warmup_ratio: 0.1
35
+ bf16: true
36
+ ddp_timeout: 180000000
37
+
38
+ ### eval
39
+ # val_size: 0.1
40
+ # per_device_eval_batch_size: 1
41
+ # eval_strategy: steps
42
+ # eval_steps: 500
InternVL/Qwen2.5-VL/LLaMA-Factory/examples/train_lora/llama3_lora_ppo.yaml ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### model
2
+ model_name_or_path: meta-llama/Meta-Llama-3-8B-Instruct
3
+ reward_model: saves/llama3-8b/lora/reward
4
+ trust_remote_code: true
5
+
6
+ ### method
7
+ stage: ppo
8
+ do_train: true
9
+ finetuning_type: lora
10
+ lora_rank: 8
11
+ lora_target: all
12
+
13
+ ### dataset
14
+ dataset: identity,alpaca_en_demo
15
+ template: llama3
16
+ cutoff_len: 2048
17
+ max_samples: 1000
18
+ overwrite_cache: true
19
+ preprocessing_num_workers: 16
20
+
21
+ ### output
22
+ output_dir: saves/llama3-8b/lora/ppo
23
+ logging_steps: 10
24
+ save_steps: 500
25
+ plot_loss: true
26
+ overwrite_output_dir: true
27
+
28
+ ### train
29
+ per_device_train_batch_size: 1
30
+ gradient_accumulation_steps: 8
31
+ learning_rate: 1.0e-5
32
+ num_train_epochs: 3.0
33
+ lr_scheduler_type: cosine
34
+ warmup_ratio: 0.1
35
+ bf16: true
36
+ ddp_timeout: 180000000
37
+
38
+ ### generate
39
+ max_new_tokens: 512
40
+ top_k: 0
41
+ top_p: 0.9
InternVL/Qwen2.5-VL/LLaMA-Factory/examples/train_lora/llama3_lora_pretrain.yaml ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### model
2
+ model_name_or_path: meta-llama/Meta-Llama-3-8B-Instruct
3
+ trust_remote_code: true
4
+
5
+ ### method
6
+ stage: pt
7
+ do_train: true
8
+ finetuning_type: lora
9
+ lora_rank: 8
10
+ lora_target: all
11
+
12
+ ### dataset
13
+ dataset: c4_demo
14
+ cutoff_len: 2048
15
+ max_samples: 1000
16
+ overwrite_cache: true
17
+ preprocessing_num_workers: 16
18
+
19
+ ### output
20
+ output_dir: saves/llama3-8b/lora/pretrain
21
+ logging_steps: 10
22
+ save_steps: 500
23
+ plot_loss: true
24
+ overwrite_output_dir: true
25
+
26
+ ### train
27
+ per_device_train_batch_size: 1
28
+ gradient_accumulation_steps: 8
29
+ learning_rate: 1.0e-4
30
+ num_train_epochs: 3.0
31
+ lr_scheduler_type: cosine
32
+ warmup_ratio: 0.1
33
+ bf16: true
34
+ ddp_timeout: 180000000
35
+
36
+ ### eval
37
+ # val_size: 0.1
38
+ # per_device_eval_batch_size: 1
39
+ # eval_strategy: steps
40
+ # eval_steps: 500
InternVL/Qwen2.5-VL/LLaMA-Factory/examples/train_lora/llama3_lora_reward.yaml ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### model
2
+ model_name_or_path: meta-llama/Meta-Llama-3-8B-Instruct
3
+ trust_remote_code: true
4
+
5
+ ### method
6
+ stage: rm
7
+ do_train: true
8
+ finetuning_type: lora
9
+ lora_rank: 8
10
+ lora_target: all
11
+
12
+ ### dataset
13
+ dataset: dpo_en_demo
14
+ template: llama3
15
+ cutoff_len: 2048
16
+ max_samples: 1000
17
+ overwrite_cache: true
18
+ preprocessing_num_workers: 16
19
+
20
+ ### output
21
+ output_dir: saves/llama3-8b/lora/reward
22
+ logging_steps: 10
23
+ save_steps: 500
24
+ plot_loss: true
25
+ overwrite_output_dir: true
26
+
27
+ ### train
28
+ per_device_train_batch_size: 1
29
+ gradient_accumulation_steps: 8
30
+ learning_rate: 1.0e-4
31
+ num_train_epochs: 3.0
32
+ lr_scheduler_type: cosine
33
+ warmup_ratio: 0.1
34
+ bf16: true
35
+ ddp_timeout: 180000000
36
+
37
+ ### eval
38
+ # val_size: 0.1
39
+ # per_device_eval_batch_size: 1
40
+ # eval_strategy: steps
41
+ # eval_steps: 500
InternVL/Qwen2.5-VL/LLaMA-Factory/examples/train_lora/llama3_lora_sft.yaml ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### model
2
+ model_name_or_path: meta-llama/Meta-Llama-3-8B-Instruct
3
+ trust_remote_code: true
4
+
5
+ ### method
6
+ stage: sft
7
+ do_train: true
8
+ finetuning_type: lora
9
+ lora_rank: 8
10
+ lora_target: all
11
+
12
+ ### dataset
13
+ dataset: identity,alpaca_en_demo
14
+ template: llama3
15
+ cutoff_len: 2048
16
+ max_samples: 1000
17
+ overwrite_cache: true
18
+ preprocessing_num_workers: 16
19
+
20
+ ### output
21
+ output_dir: saves/llama3-8b/lora/sft
22
+ logging_steps: 10
23
+ save_steps: 500
24
+ plot_loss: true
25
+ overwrite_output_dir: true
26
+
27
+ ### train
28
+ per_device_train_batch_size: 1
29
+ gradient_accumulation_steps: 8
30
+ learning_rate: 1.0e-4
31
+ num_train_epochs: 3.0
32
+ lr_scheduler_type: cosine
33
+ warmup_ratio: 0.1
34
+ bf16: true
35
+ ddp_timeout: 180000000
36
+
37
+ ### eval
38
+ # val_size: 0.1
39
+ # per_device_eval_batch_size: 1
40
+ # eval_strategy: steps
41
+ # eval_steps: 500
InternVL/Qwen2.5-VL/LLaMA-Factory/examples/train_lora/llama3_lora_sft_ds3.yaml ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### model
2
+ model_name_or_path: meta-llama/Meta-Llama-3-8B-Instruct
3
+ trust_remote_code: true
4
+
5
+ ### method
6
+ stage: sft
7
+ do_train: true
8
+ finetuning_type: lora
9
+ lora_rank: 8
10
+ lora_target: all
11
+ deepspeed: examples/deepspeed/ds_z3_config.json # choices: [ds_z0_config.json, ds_z2_config.json, ds_z3_config.json]
12
+
13
+ ### dataset
14
+ dataset: identity,alpaca_en_demo
15
+ template: llama3
16
+ cutoff_len: 2048
17
+ max_samples: 1000
18
+ overwrite_cache: true
19
+ preprocessing_num_workers: 16
20
+
21
+ ### output
22
+ output_dir: saves/llama3-8b/lora/sft
23
+ logging_steps: 10
24
+ save_steps: 500
25
+ plot_loss: true
26
+ overwrite_output_dir: true
27
+
28
+ ### train
29
+ per_device_train_batch_size: 1
30
+ gradient_accumulation_steps: 2
31
+ learning_rate: 1.0e-4
32
+ num_train_epochs: 3.0
33
+ lr_scheduler_type: cosine
34
+ warmup_ratio: 0.1
35
+ bf16: true
36
+ ddp_timeout: 180000000
37
+
38
+ ### eval
39
+ # val_size: 0.1
40
+ # per_device_eval_batch_size: 1
41
+ # eval_strategy: steps
42
+ # eval_steps: 500
InternVL/Qwen2.5-VL/LLaMA-Factory/examples/train_lora/llama3_lora_sft_ray.yaml ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### model
2
+ model_name_or_path: meta-llama/Meta-Llama-3-8B-Instruct # or use local absolute path
3
+ trust_remote_code: true
4
+
5
+ ### method
6
+ stage: sft
7
+ do_train: true
8
+ finetuning_type: lora
9
+ lora_rank: 8
10
+ lora_target: all
11
+
12
+ ### dataset
13
+ dataset: identity,alpaca_en_demo
14
+ dataset_dir: REMOTE:llamafactory/demo_data # or use local absolute path
15
+ template: llama3
16
+ cutoff_len: 2048
17
+ max_samples: 1000
18
+ overwrite_cache: true
19
+ preprocessing_num_workers: 16
20
+
21
+ ### output
22
+ output_dir: tmp_dir
23
+ logging_steps: 10
24
+ save_steps: 500
25
+ plot_loss: true
26
+ overwrite_output_dir: true
27
+
28
+ ### ray
29
+ ray_run_name: llama3_8b_sft_lora
30
+ ray_num_workers: 4 # number of GPUs to use
31
+ resources_per_worker:
32
+ GPU: 1
33
+ placement_strategy: PACK
34
+
35
+ ### train
36
+ per_device_train_batch_size: 1
37
+ gradient_accumulation_steps: 8
38
+ learning_rate: 1.0e-4
39
+ num_train_epochs: 3.0
40
+ lr_scheduler_type: cosine
41
+ warmup_ratio: 0.1
42
+ bf16: true
43
+ ddp_timeout: 180000000
44
+
45
+ ### eval
46
+ # val_size: 0.1
47
+ # per_device_eval_batch_size: 1
48
+ # eval_strategy: steps
49
+ # eval_steps: 500
InternVL/Qwen2.5-VL/LLaMA-Factory/examples/train_lora/llama3_preprocess.yaml ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### model
2
+ model_name_or_path: meta-llama/Meta-Llama-3-8B-Instruct
3
+ trust_remote_code: true
4
+
5
+ ### method
6
+ stage: sft
7
+ do_train: true
8
+ finetuning_type: lora
9
+ lora_rank: 8
10
+ lora_target: all
11
+
12
+ ### dataset
13
+ dataset: identity,alpaca_en_demo
14
+ template: llama3
15
+ cutoff_len: 2048
16
+ max_samples: 1000
17
+ overwrite_cache: true
18
+ preprocessing_num_workers: 16
19
+ tokenized_path: saves/llama3-8b/dataset/sft
20
+
21
+ ### output
22
+ output_dir: saves/llama3-8b/lora/sft
23
+ overwrite_output_dir: true
InternVL/Qwen2.5-VL/LLaMA-Factory/examples/train_lora/llava1_5_lora_sft.yaml ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### model
2
+ model_name_or_path: llava-hf/llava-1.5-7b-hf
3
+ trust_remote_code: true
4
+
5
+ ### method
6
+ stage: sft
7
+ do_train: true
8
+ finetuning_type: lora
9
+ lora_rank: 8
10
+ lora_target: all
11
+
12
+ ### dataset
13
+ dataset: mllm_demo
14
+ template: llava
15
+ cutoff_len: 2048
16
+ max_samples: 1000
17
+ overwrite_cache: true
18
+ preprocessing_num_workers: 16
19
+
20
+ ### output
21
+ output_dir: saves/llava1_5-7b/lora/sft
22
+ logging_steps: 10
23
+ save_steps: 500
24
+ plot_loss: true
25
+ overwrite_output_dir: true
26
+
27
+ ### train
28
+ per_device_train_batch_size: 1
29
+ gradient_accumulation_steps: 8
30
+ learning_rate: 1.0e-4
31
+ num_train_epochs: 3.0
32
+ lr_scheduler_type: cosine
33
+ warmup_ratio: 0.1
34
+ bf16: true
35
+ ddp_timeout: 180000000
36
+
37
+ ### eval
38
+ # val_size: 0.1
39
+ # per_device_eval_batch_size: 1
40
+ # eval_strategy: steps
41
+ # eval_steps: 500
InternVL/Qwen2.5-VL/LLaMA-Factory/examples/train_lora/qwen2vl_lora_dpo.yaml ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### model
2
+ model_name_or_path: Qwen/Qwen2-VL-7B-Instruct
3
+ image_max_pixels: 262144
4
+ video_max_pixels: 16384
5
+ trust_remote_code: true
6
+
7
+ ### method
8
+ stage: dpo
9
+ do_train: true
10
+ finetuning_type: lora
11
+ lora_rank: 8
12
+ lora_target: all
13
+ pref_beta: 0.1
14
+ pref_loss: sigmoid # choices: [sigmoid (dpo), orpo, simpo]
15
+
16
+ ### dataset
17
+ dataset: rlhf_v
18
+ template: qwen2_vl
19
+ cutoff_len: 2048
20
+ max_samples: 1000
21
+ overwrite_cache: true
22
+ preprocessing_num_workers: 16
23
+
24
+ ### output
25
+ output_dir: saves/qwen2_vl-7b/lora/dpo
26
+ logging_steps: 10
27
+ save_steps: 500
28
+ plot_loss: true
29
+ overwrite_output_dir: true
30
+
31
+ ### train
32
+ per_device_train_batch_size: 1
33
+ gradient_accumulation_steps: 8
34
+ learning_rate: 5.0e-6
35
+ num_train_epochs: 3.0
36
+ lr_scheduler_type: cosine
37
+ warmup_ratio: 0.1
38
+ bf16: true
39
+ ddp_timeout: 180000000
40
+
41
+ ### eval
42
+ # val_size: 0.1
43
+ # per_device_eval_batch_size: 1
44
+ # eval_strategy: steps
45
+ # eval_steps: 500