Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1620 commits
Select commit Hold shift + click to select a range
b5d101e
fix data map for packing
hiyouga Jul 3, 2024
44747ce
tiny fix
hiyouga Jul 3, 2024
0c699de
tiny fix
hiyouga Jul 3, 2024
636bb9c
update tests
hiyouga Jul 3, 2024
738df47
tiny fix
hzhaoy Jul 4, 2024
07d96d4
Merge pull request #4673 from hzhaoy/main
hiyouga Jul 4, 2024
1e27e8c
fix #4677
hiyouga Jul 4, 2024
226a9e5
Merge branch 'main' of https://github.com/hiyouga/LLaMA-Factory
hiyouga Jul 4, 2024
ed23231
fix #4674
hiyouga Jul 4, 2024
e43809b
fix #4683
hiyouga Jul 4, 2024
9f33f1e
fix processors
hiyouga Jul 5, 2024
76f3bbc
1. add custom eval dataset support
codemayq Jul 5, 2024
c9bb075
update pissa example
hiyouga Jul 6, 2024
53b1002
add codegeex4, internlm2.5
hiyouga Jul 6, 2024
e056252
Update utils.py
marko1616 Jul 6, 2024
a15782c
fix #4705
hiyouga Jul 7, 2024
322663b
chore: Update vllm_engine.py to support vllm version >= 0.5.1
T-Atlas Jul 7, 2024
f84b007
Update packages.py
hiyouga Jul 7, 2024
563a27d
Merge pull request #4706 from T-Atlas/main
hiyouga Jul 7, 2024
86b1594
Update wechat.jpg
hiyouga Jul 9, 2024
2f09520
fix #4742
hiyouga Jul 9, 2024
fb0c400
fix ppo trainer
hiyouga Jul 10, 2024
51942ac
fix #4731
hiyouga Jul 10, 2024
cff89a2
fix src/llamafactory/train/callbacks.py
yzoaim Jul 10, 2024
39cd89c
Update callbacks.py
hiyouga Jul 10, 2024
40c3b88
Merge pull request #4746 from yzoaim/fix
hiyouga Jul 10, 2024
555194e
Merge pull request #4700 from marko1616/patch-1
hiyouga Jul 10, 2024
67040f1
update wechat_npu.jpg
codemayq Jul 11, 2024
a8bf1ab
fix #4779
hzhaoy Jul 11, 2024
642c6d6
fix #4780
hzhaoy Jul 11, 2024
8bab99c
tiny fix
hzhaoy Jul 11, 2024
982a1cd
1. fix output_dir in llama3_lora_pretrain.yaml
codemayq Jul 13, 2024
f618b80
Update llava1_5.yaml
hiyouga Jul 13, 2024
32699a8
Merge pull request #4804 from codemayq/fix-examples
hiyouga Jul 13, 2024
6b48308
fix #4792
hiyouga Jul 13, 2024
5da54de
Merge pull request #4781 from hzhaoy/fix-dockerfile-cuda
hiyouga Jul 13, 2024
7b19e99
update workflows
hiyouga Jul 13, 2024
2f6af73
fix gemma2 attention
hiyouga Jul 13, 2024
d3c0155
tiny fix
hiyouga Jul 14, 2024
88a20ba
fix #4699
hiyouga Jul 14, 2024
1739214
fix test
hiyouga Jul 14, 2024
f1d8d29
add gemma test
hiyouga Jul 14, 2024
9d64507
Update README.md
hiyouga Jul 14, 2024
3d39d74
Update parser.py
hiyouga Jul 14, 2024
a4ae3ab
update test template
hiyouga Jul 14, 2024
a5b8095
Update loader.py
hiyouga Jul 14, 2024
97a0e29
Update data_utils.py
hiyouga Jul 14, 2024
84e4047
Update parser.py
hiyouga Jul 14, 2024
df52fb0
Update preprocess.py
hiyouga Jul 14, 2024
cba673f
Update data_args.py
hiyouga Jul 14, 2024
15b399a
Merge pull request #4691 from codemayq/feature-suppot-eval-dataset
hiyouga Jul 14, 2024
29ebcd7
fix up
hiyouga Jul 14, 2024
99ab7a8
allow computing rouge in training
hiyouga Jul 14, 2024
645211d
1. change the task name format
codemayq Jul 15, 2024
32c3afd
add IN_GITHUB_ACTIONS
codemayq Jul 15, 2024
b0aa321
update wechat
hiyouga Jul 15, 2024
fd8cc49
fix #4820
hiyouga Jul 15, 2024
52a4256
Update test_template.py
hiyouga Jul 15, 2024
33420ba
Update test_template.py
hiyouga Jul 15, 2024
91ba083
Update llama3_lora_eval.yaml
hiyouga Jul 15, 2024
38bc411
Merge pull request #4821 from codemayq/feature-eval-split
hiyouga Jul 15, 2024
da990f7
Update test_template.py
hiyouga Jul 15, 2024
10289ea
Update test_template.py
hiyouga Jul 15, 2024
f2aaebd
Merge pull request #4822 from codemayq/test-ci
hiyouga Jul 15, 2024
bda302f
tiny fix
hiyouga Jul 15, 2024
d774b94
support batch_eval_metrics, fix #4826
hiyouga Jul 16, 2024
beec77a
fix metrics #4786
hiyouga Jul 16, 2024
1e7b396
仅仅训练最后一轮对话
aofengdaxia Jul 18, 2024
2516763
Merge pull request #4878 from ly863/main
hiyouga Jul 18, 2024
779aae8
follow #4878 fix #4684
hiyouga Jul 18, 2024
608de79
add unittest
hiyouga Jul 18, 2024
e800067
fix unittest
hiyouga Jul 18, 2024
cdb0f34
fix test
hiyouga Jul 18, 2024
bbd5a64
release v0.8.3
hiyouga Jul 18, 2024
8f69950
update parser
hiyouga Jul 18, 2024
88c7fc1
set dev version
hiyouga Jul 18, 2024
44e48e2
update deepseek template
Jul 19, 2024
ad71296
update wechat
hiyouga Jul 20, 2024
4135e69
fix flashattn + packing
hiyouga Jul 21, 2024
c333e2f
tiny fix
hiyouga Jul 21, 2024
26082fc
fix #4917
hiyouga Jul 22, 2024
5665062
tiny fix
hiyouga Jul 22, 2024
bb0a37d
Update wechat_npu.jpg
hiyouga Jul 22, 2024
f91a9a2
fix: Repair the issue where quantization failed after merging the ada…
liuwwang Jul 24, 2024
26533c0
add llama3.1
hiyouga Jul 24, 2024
1550fe7
add mistral nemo model
hiyouga Jul 24, 2024
1bbd49f
fix #4944
hiyouga Jul 24, 2024
935b22d
fix #4925
hiyouga Jul 24, 2024
0910104
fix #4928
hiyouga Jul 24, 2024
ace1d44
tiny fix
hiyouga Jul 24, 2024
5626bdc
Update README.md
hiyouga Jul 24, 2024
71d3e60
Update README_zh.md
hiyouga Jul 24, 2024
30f8149
update webui
hiyouga Jul 24, 2024
77cff78
fix #4959
hiyouga Jul 24, 2024
ceba96f
Added the reference address for TRL PPO details.
khazic Jul 25, 2024
c8e18a6
Add ROCm support
HardAndHeavy Jul 25, 2024
024c49d
update wechat.jpg
codemayq Jul 26, 2024
f97beca
Update README.md
hiyouga Jul 26, 2024
1186ad5
Update README.md
hiyouga Jul 26, 2024
77e7bfe
Update README_zh.md
hiyouga Jul 26, 2024
3c424cf
Merge pull request #4961 from khazic/main
hiyouga Jul 26, 2024
b8896b9
Merge pull request #4970 from HardAndHeavy/add-rocm
hiyouga Jul 26, 2024
9839c6d
Merge pull request #4950 from liuwwang/main and fi
hiyouga Jul 26, 2024
8a2846c
Merge pull request #4892 from piamo/main
hiyouga Jul 26, 2024
668654b
tiny fix
hiyouga Jul 26, 2024
2c1ca9f
fix pissa save
codemayq Jul 29, 2024
b9ed9d4
增加了MiniCPM在页面首页的支持列表,MiniCPM官方github也放了LLama_factory的友情链接
Jul 29, 2024
371009e
Add Korean web UI (llamafactory-cli webui)
Eruly Jul 29, 2024
daa62db
Merge pull request #4995 from codemayq/fix-pissa
hiyouga Jul 29, 2024
8d5a41f
Update README.md
hiyouga Jul 29, 2024
9e409ea
Update README.md
hiyouga Jul 29, 2024
3a49c76
Update README_zh.md
hiyouga Jul 29, 2024
06e17eb
Merge pull request #4996 from LDLINGLINGLING/main
hiyouga Jul 29, 2024
cd420c1
Merge pull request #5010 from Eruly/main
hiyouga Jul 29, 2024
3885949
update wechat_npu.jpg
codemayq Jul 30, 2024
1c05b84
update wechat.jpg
codemayq Aug 1, 2024
dc09d45
support gemma-2-2b
codemayq Aug 1, 2024
c2921b9
Merge pull request #5037 from codemayq/feature-gemma-2-2b
hiyouga Aug 5, 2024
b7ca6c8
fix #5048
hiyouga Aug 5, 2024
b82ecbe
fix: fix the deepseekcoder template to avoid repeat problem
relic-yuexi Aug 5, 2024
55f32df
Merge branch 'hiyouga:main' into main
relic-yuexi Aug 5, 2024
40908a3
fix: rename optimzer to optimizer
relic-yuexi Aug 7, 2024
82bc15d
feat: add support for adammini
relic-yuexi Aug 7, 2024
823e7c1
fix eval_dataset in example
codemayq Aug 7, 2024
9a48f7e
update wechat.jpg
codemayq Aug 7, 2024
18e455c
Merge pull request #5109 from codemayq/fix-example
codemayq Aug 7, 2024
b5ca86c
fix mask_history tiny bug
YeQiuO Aug 8, 2024
2fa1e0b
mask_history args verify valid
YeQiuO Aug 8, 2024
4f62e1c
Update template.py
hiyouga Aug 9, 2024
984961c
Merge pull request #5072 from relic-yuexi/main
hiyouga Aug 9, 2024
51542cb
Merge pull request #5115 from YeQiuO/main
hiyouga Aug 9, 2024
c87023d
follow #5115
hiyouga Aug 9, 2024
86f7099
update scripts
hiyouga Aug 9, 2024
ef48239
Merge pull request #5095 from relic-yuexi/feat-optimizer
hiyouga Aug 9, 2024
e2a28f5
add adam_mini to readme
hiyouga Aug 9, 2024
0a690ad
update examples
hiyouga Aug 9, 2024
dc770ef
add qwen2 math models
hiyouga Aug 9, 2024
c75b5b8
add magpie ultra dataset
hiyouga Aug 9, 2024
576a894
update readme
hiyouga Aug 9, 2024
c93d55b
update readme
hiyouga Aug 10, 2024
bcbbf45
fix Llama-template's system prompt bug
YeQiuO Aug 12, 2024
5b9d99e
update wechat.jpg
codemayq Aug 13, 2024
625a0e3
add tutorial and doc links
codemayq Aug 13, 2024
ddee718
fix lr not change
liu-zichen Aug 13, 2024
2502833
Add SailorLLM template
chenhuiyu Aug 15, 2024
dc36fcc
fix: report correct device count for intel xpu
Zxilly Aug 15, 2024
384ab8d
_is_bf16_available judgment supports npu
Ricardo-L-C Aug 16, 2024
3804dde
update readme
hiyouga Aug 19, 2024
5f3300e
Update template.py
hiyouga Aug 19, 2024
5d5bfc8
Merge pull request #5193 from Ricardo-L-C/main
hiyouga Aug 19, 2024
d39f4a6
Merge pull request #5188 from Zxilly/main
hiyouga Aug 19, 2024
f59c9be
Merge pull request #5185 from chenhuiyu/feature/add-sailorllm-template
hiyouga Aug 19, 2024
da335d4
Merge pull request #5163 from liu-zichen/fix_ppo_optim
hiyouga Aug 19, 2024
ec72eec
Update template.py
hiyouga Aug 19, 2024
15be296
Merge pull request #5156 from YeQiuO/main
hiyouga Aug 19, 2024
c8b4c7f
tiny fix
hiyouga Aug 19, 2024
b3f4acd
update npu base image
MengqingCao Aug 21, 2024
8907150
update wechat
hiyouga Aug 21, 2024
36039b0
Merge pull request #5230 from MengqingCao/image
hiyouga Aug 21, 2024
a4f1de9
Update chat.py
marko1616 Aug 22, 2024
8eb2092
Update chat.py
marko1616 Aug 22, 2024
3a28521
Force re check.
marko1616 Aug 23, 2024
72bc8f0
support liger kernel
hiyouga Aug 27, 2024
1545684
Update chat.py
marko1616 Aug 27, 2024
df8d5b6
ruff pass.
marko1616 Aug 27, 2024
dbe886a
Merge pull request #5237 from marko1616/patch-1
hiyouga Aug 27, 2024
f6ae4e7
tiny fix
hiyouga Aug 27, 2024
d14edd3
add extra requires
hiyouga Aug 27, 2024
0f5a0f6
update wechat
hiyouga Aug 27, 2024
aeb85f2
initial-commit
simonJJJ Aug 28, 2024
734e019
update
simonJJJ Aug 28, 2024
364b757
fix #5305
hiyouga Aug 29, 2024
ad72f3e
fix #5295
hiyouga Aug 29, 2024
aa1afdc
fix #5292
hiyouga Aug 29, 2024
a7dd7d3
update liger kernel
hiyouga Aug 29, 2024
a8f22d8
fix bug
hiyouga Aug 29, 2024
727e184
Merge pull request #5290 from simonJJJ/qwen2_vl
hiyouga Aug 29, 2024
3382317
refactor mm training
hiyouga Aug 29, 2024
8b588c7
fix #5307
hiyouga Aug 29, 2024
bee1bd4
tiny fix
hiyouga Aug 29, 2024
e08045a
add examples
hiyouga Aug 30, 2024
a244f14
optimize predict vram
hiyouga Aug 30, 2024
a025c3d
remove visual_inputs, fix qlora
hiyouga Aug 30, 2024
a2a8c0b
add test mm plugin
hiyouga Aug 30, 2024
b5063b4
fix ci (temp)
hiyouga Aug 30, 2024
b8a9cb5
Add liger kernel link
ByronHsu Aug 31, 2024
9967ccb
fix mixed mm inputs and rlhf-v
hiyouga Sep 1, 2024
64cb947
fix bug
hiyouga Sep 1, 2024
5502728
tiny fix
hiyouga Sep 1, 2024
8e49940
add rlhf-v dataset
hiyouga Sep 1, 2024
6f9e455
Merge pull request #5317 from ByronHsu/patch-1
hiyouga Sep 1, 2024
753c5fb
update wechat
hiyouga Sep 1, 2024
a8f8a2a
update readme
hiyouga Sep 1, 2024
194064f
add pokemon dataset
hiyouga Sep 1, 2024
ce8c5a2
add image num check
hiyouga Sep 1, 2024
3a6f19f
tiny fix
hiyouga Sep 1, 2024
60fc6b9
fix mm inference
hiyouga Sep 1, 2024
a6c6750
remove .cpu()
hiyouga Sep 2, 2024
99fd963
fix trainer predict
hiyouga Sep 2, 2024
209313e
feat: add batch size of map function in the preprocessed dataset
Sep 2, 2024
a61c8c4
fix #5324
hiyouga Sep 2, 2024
22959bc
lint
hiyouga Sep 2, 2024
69d0aca
fix #5338
hiyouga Sep 3, 2024
59d2b31
fix #5334
hiyouga Sep 3, 2024
47ea97f
lazy image load
hiyouga Sep 3, 2024
ce7ed6e
Merge pull request #5346 from hiyouga/lazy_image
hiyouga Sep 3, 2024
d41d43a
fix #5344
hiyouga Sep 3, 2024
5749713
add vl_feedback dataset
hiyouga Sep 3, 2024
ebddce5
fix #5252
hiyouga Sep 3, 2024
44d6947
fix #5228
hiyouga Sep 4, 2024
8f441c2
Merge pull request #5323 from naem1023/feat/add-dataset-map-batch-siz…
hiyouga Sep 4, 2024
dabad55
update get template
hiyouga Sep 4, 2024
c5e1736
fix test
hiyouga Sep 4, 2024
d7ba97b
增加了对minicpm3.0的适配'
LDLINGLINGLING Sep 4, 2024
8cafc7b
video datasets
hiyouga Sep 4, 2024
c122b9f
tiny fix
hiyouga Sep 4, 2024
46b1765
Merge pull request #5365 from hiyouga/video_finetuning
hiyouga Sep 4, 2024
315284f
update ci
hiyouga Sep 4, 2024
b6a3fdd
fix ci
hiyouga Sep 4, 2024
1173f7f
fix ci
hiyouga Sep 4, 2024
359ef8b
support Yi-Coder models
hiyouga Sep 4, 2024
6055fe0
update data readme
hiyouga Sep 4, 2024
70e36ff
update data readme
hiyouga Sep 4, 2024
e9bda48
fix #5366
hiyouga Sep 5, 2024
3d3fbaa
根据代码规范修改了代码
LDLINGLINGLING Sep 5, 2024
1274356
Merge pull request #5372 from LDLINGLINGLING/main
hiyouga Sep 5, 2024
94d5b1b
add e2e tests
hiyouga Sep 5, 2024
2f939b7
fix ci
hiyouga Sep 5, 2024
eb5aa9a
fix ci
hiyouga Sep 5, 2024
76f2e59
tiny fix
hiyouga Sep 5, 2024
36665f3
fix #5384
hiyouga Sep 6, 2024
66ec365
update cal_mfu.py
yzoaim Sep 7, 2024
e71133c
Update cal_mfu.py
hiyouga Sep 7, 2024
842c545
fix
hiyouga Sep 7, 2024
8eac1b9
Merge pull request #5388 from yzoaim/cal_mfu_update
hiyouga Sep 7, 2024
54c6905
add docstrings, refactor logger
hiyouga Sep 7, 2024
fb72a3a
support activation offloading via unsloth gc
hiyouga Sep 7, 2024
52a06ef
add test case
hiyouga Sep 7, 2024
b332908
fix test case
hiyouga Sep 7, 2024
b6681d7
support vllm 0.6.0
hiyouga Sep 7, 2024
f2aa02c
update scripts
hiyouga Sep 8, 2024
6011417
update wechat
hiyouga Sep 8, 2024
c9b3870
tiny fix
hiyouga Sep 8, 2024
54b5c4b
release v0.9.0
hiyouga Sep 8, 2024
653fe70
fix constants
hiyouga Sep 8, 2024
90d6df6
release v0.9.0 (real)
hiyouga Sep 8, 2024
15a0cf4
update llama 0.9.0
yaojin3616 Oct 23, 2024
9d886ed
update llama 0.9.0
yaojin3616 Oct 23, 2024
2087f9a
update llama 0.9.0
yaojin3616 Oct 23, 2024
7150bc9
update 0.9.0
yaojin3616 Oct 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
13 changes: 13 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.vscode
.git
.github
.venv
cache
data
docker
saves
hf_cache
output
.dockerignore
.gitattributes
.gitignore
8 changes: 5 additions & 3 deletions .drone.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ clone:
disable: true

trigger:
ref:
- refs/tags/v*
# ref:
# - refs/tags/v*
branch:
- feat/*

steps: # 定义流水线执行步骤,这些步骤将顺序执行
- name: clone
Expand Down Expand Up @@ -38,7 +40,7 @@ steps: # 定义流水线执行步骤,这些步骤将顺序执行
https_proxy:
from_secret: PROXY
no_proxy: 192.168.106.8,192.168.106.8
version: ${DRONE_TAG}
version: "test"
docker_repo: dataelement/bisheng-ft
docker_user:
from_secret: DOCKER_USER
Expand Down
35 changes: 35 additions & 0 deletions .env.local
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Note: actually we do not support .env, just for reference
# api
API_HOST=0.0.0.0
API_PORT=8000
API_KEY=
API_MODEL_NAME=gpt-3.5-turbo
FASTAPI_ROOT_PATH=
# general
DISABLE_VERSION_CHECK=
FORCE_CHECK_IMPORTS=
FORCE_TORCHRUN=
LLAMAFACTORY_VERBOSITY=
USE_MODELSCOPE_HUB=
RECORD_VRAM=
# torchrun
FORCE_TORCHRUN=
MASTER_ADDR=
MASTER_PORT=
NNODES=
RANK=
NPROC_PER_NODE=
# wandb
WANDB_DISABLED=
WANDB_PROJECT=huggingface
WANDB_API_KEY=
# gradio ui
GRADIO_SHARE=False
GRADIO_SERVER_NAME=0.0.0.0
GRADIO_SERVER_PORT=
GRADIO_ROOT_PATH=
# setup
ENABLE_SHORT_CONSOLE=1
# reserved (do not use)
LLAMABOARD_ENABLED=
LLAMABOARD_WORKDIR=
128 changes: 128 additions & 0 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
# Contributor Covenant Code of Conduct

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.

## Our Standards

Examples of behavior that contributes to a positive environment for our
community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
overall community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.

Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.

## Scope

This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
`hoshihiyouga AT gmail DOT com`.
All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
reporter of any incident.

## Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:

### 1. Correction

**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.

**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series
of actions.

**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.

### 3. Temporary Ban

**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.

**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within
the community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.

Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.
21 changes: 21 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Contributing to LLaMA Factory

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.

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.

However you choose to contribute, please be mindful and respect our [code of conduct](CODE_OF_CONDUCT.md).

**This guide was heavily inspired by [transformers guide to contributing](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md).**

## Ways to contribute

There are several ways you can contribute to LLaMA Factory:

* Fix outstanding issues with the existing code.
* Submit issues related to bugs or desired new features.
* Contribute to the examples or to the documentation.

### Style guide

LLaMA Factory follows the [Google Python Style Guide](https://google.github.io/styleguide/pyguide.html), check it for details.
66 changes: 66 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: "\U0001F41B Bug / Help"
description: Create a report to help us improve the LLaMA Factory
body:
- type: markdown
attributes:
value: |
Issues included in **FAQs** or those with **insufficient** information may be closed without a response.
包含在**常见问题**内或提供信息**不完整**的 issues 可能不会被回复。

- type: checkboxes
id: reminder
attributes:
label: Reminder
description: |
Please ensure you have read the README carefully and searched the existing issues (including FAQs).
请确保您已经认真阅读了 README 并且搜索过现有的 issues(包括常见问题)。

options:
- label: I have read the README and searched the existing issues.
required: true

- type: textarea
id: system-info
validations:
required: true
attributes:
label: System Info
description: |
Please share your system info with us. You can run the command **llamafactory-cli env** and copy-paste its output below.
请提供您的系统信息。您可以在命令行运行 **llamafactory-cli env** 并将其输出复制到该文本框中。

placeholder: llamafactory version, platform, python version, ...

- type: textarea
id: reproduction
validations:
required: true
attributes:
label: Reproduction
description: |
Please provide code snippets, error messages and stack traces that reproduces the problem.
请提供运行参数,错误信息以及异常堆栈以便于我们复现该问题。
Remember to use Markdown tags to correctly format your code.
请合理使用 Markdown 标签来格式化您的文本。

placeholder: |
```bash
llamafactory-cli train ...
```

- type: textarea
id: expected-behavior
validations:
required: false
attributes:
label: Expected behavior
description: |
Please provide a clear and concise description of what you would expect to happen.
请提供您原本的目的,即这段代码的期望行为。

- type: textarea
id: others
validations:
required: false
attributes:
label: Others
8 changes: 8 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# What does this PR do?

Fixes # (issue)

## Before submitting

- [ ] Did you read the [contributor guideline](https://github.com/hiyouga/LLaMA-Factory/blob/main/.github/CONTRIBUTING.md)?
- [ ] Did you write any new necessary tests?
7 changes: 7 additions & 0 deletions .github/SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Reporting Security Issues

To report a security issue, please use the GitHub Security Advisory ["Report a Vulnerability"](https://github.com/hiyouga/LLaMA-Factory/security/advisories/new) tab.

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.

Report security bugs in third-party modules to the person or team maintaining the module.
30 changes: 30 additions & 0 deletions .github/workflows/label_issue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: label_issue

on:
issues:
types:
- opened

jobs:
label_issue:
runs-on: ubuntu-latest

permissions:
issues: write

steps:
- env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ISSUE_URL: ${{ github.event.issue.html_url }}
ISSUE_TITLE: ${{ github.event.issue.title }}
run: |
LABEL=pending
NPU_KEYWORDS=(npu huawei ascend 华为 昇腾)
ISSUE_TITLE_LOWER=$(echo $ISSUE_TITLE | tr '[:upper:]' '[:lower:]')
for KEYWORD in ${NPU_KEYWORDS[@]}; do
if [[ $ISSUE_TITLE_LOWER == *$KEYWORD* ]] && [[ $ISSUE_TITLE_LOWER != *input* ]]; then
LABEL=pending,npu
break
fi
done
gh issue edit $ISSUE_URL --add-label $LABEL
40 changes: 40 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: publish

on:
release:
types:
- published

jobs:
publish:
name: Upload release to PyPI

runs-on: ubuntu-latest

environment:
name: release
url: https://pypi.org/p/llamafactory

permissions:
id-token: write

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.8"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install build

- name: Build package
run: |
python -m build

- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
Loading