llama-factory-annotations
Science Score: 44.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (5.4%) to scientific vocabulary
Repository
Basic Info
- Host: GitHub
- Owner: WohimLee
- License: apache-2.0
- Language: Python
- Default Branch: main
- Size: 8.5 MB
Statistics
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 0
Metadata Files
README.md
LLaMA-Factory 调试版本
官方原版仓库: https://github.com/hiyouga/LLaMA-Factory
调试
所有调试开始前修改一下这个文件: - src/llamafactory/hparams/parser.py
py
def _parse_train_args(args: Optional[Dict[str, Any]] = None): # -> _TRAIN_CLS
parser = HfArgumentParser(_TRAIN_ARGS)
parser.add_argument('--local-rank', type=int, default=0, help="Local rank for distributed training") # 添加这行
return _parse_args(parser, args)
1 调试 cli.py
命令
sh FORCE_TORCHRUN=1 llamafactory-cli train examples/train_full/llama3_full_sft_ds3.yamllaunch.json ```json { // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File",
"type": "debugpy",
"request": "launch",
"program": "${workspaceFolder}/run-debug.py",
"args": [
],
"cwd": "${workspaceFolder}",
"env": {
"FORCE_TORCHRUN": "true",
"PATH": "/opt/miniconda/envs/llama39/bin:${env:PATH}" // which torchrun 找到的路径, 否则 process = subprocess.run 找不到命令会报错
},
"console": "integratedTerminal",
"justMyCode": false // 允许调试库代码
}
]
} ```
run-debug.py ```py
用来调试 llamafactory-cli 命令,
也就是 src/llamafactory/cli.py 里面的 main 函数
import sys from llamafactory.cli import main
sys.argv = ["llamafactory-cli", "train", "examples/trainfull/llama3fullsftds3.yaml"]
if name == "main": main() ```
2 调试 launcher.py
命令 - 从 1 获得
sh torchrun --nnodes 1 --node_rank 0 --nproc_per_node 1 \ --master_addr 127.0.0.1 --master_port 20570 \ /root/datav/nlp/LLama-Factory-annotations/src/llamafactory/launcher.py \ examples/train_full/llama3_full_sft_ds3.yamllaunch.json - 使用
which torchrun找到 torchrun 路径 - 然后直接把断点打在 launcher.py 里面就可以了 ```json { // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File",
"type": "debugpy",
"request": "launch",
// "module": "llamafactory.cli",
"program": "/opt/miniconda/envs/llama39/bin/torchrun", // torchrun 的完整路径
"args": [
"--nnodes", "1",
"--node_rank", "0",
"--nproc_per_node", "1",
"--master_addr", "127.0.0.1",
"--master_port", "20570",
"/root/datav/nlp/LLama-Factory-annotations/src/llamafactory/launcher.py", // 脚本路径
"examples/train_full/llama3_full_sft_ds3.yaml"
],
"cwd": "${workspaceFolder}",
"env": {
// "FORCE_TORCHRUN": "true",
"PATH": "/opt/miniconda/envs/llama39/bin:${env:PATH}"
},
"subProcess": true,
"console": "integratedTerminal",
"justMyCode": false // 允许调试库代码
}
]
} ```
3 调试
Owner
- Name: WohimLee
- Login: WohimLee
- Kind: user
- Repositories: 1
- Profile: https://github.com/WohimLee
Citation (CITATION.cff)
cff-version: 1.2.0
date-released: 2024-03
message: "If you use this software, please cite it as below."
authors:
- family-names: "Zheng"
given-names: "Yaowei"
- family-names: "Zhang"
given-names: "Richong"
- family-names: "Zhang"
given-names: "Junhao"
- family-names: "Ye"
given-names: "Yanhan"
- family-names: "Luo"
given-names: "Zheyan"
- family-names: "Feng"
given-names: "Zhangchi"
- family-names: "Ma"
given-names: "Yongqiang"
title: "LlamaFactory: Unified Efficient Fine-Tuning of 100+ Language Models"
url: "https://arxiv.org/abs/2403.13372"
preferred-citation:
type: conference-paper
conference:
name: "Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 3: System Demonstrations)"
authors:
- family-names: "Zheng"
given-names: "Yaowei"
- family-names: "Zhang"
given-names: "Richong"
- family-names: "Zhang"
given-names: "Junhao"
- family-names: "Ye"
given-names: "Yanhan"
- family-names: "Luo"
given-names: "Zheyan"
- family-names: "Feng"
given-names: "Zhangchi"
- family-names: "Ma"
given-names: "Yongqiang"
title: "LlamaFactory: Unified Efficient Fine-Tuning of 100+ Language Models"
url: "https://arxiv.org/abs/2403.13372"
year: 2024
publisher: "Association for Computational Linguistics"
address: "Bangkok, Thailand"
GitHub Events
Total
- Watch event: 1
Last Year
- Watch event: 1
Dependencies
- nvcr.io/nvidia/pytorch 24.02-py3 build
- cosdt/cann 8.0.rc1-910b-ubuntu22.04 build
- hardandheavy/transformers-rocm 2.1.0 build
- accelerate >=0.30.1
- datasets >=2.16.0
- einops *
- fastapi *
- fire *
- gradio >=4.0.0
- matplotlib >=3.7.0
- numpy <2.0.0
- packaging *
- pandas >=2.0.0
- peft >=0.11.1
- protobuf *
- pydantic *
- pyyaml *
- scipy *
- sentencepiece *
- sse-starlette *
- tiktoken *
- transformers >=4.41.2
- trl >=0.8.6
- uvicorn *
- accelerate >=0.30.1
- aqlm >=1.1.0
- auto-gptq >=0.5.0
- autoawq *
- badam >=1.2.1
- bitsandbytes >=0.39.0
- datasets >=2.16.0
- decorator *
- deepspeed >=0.10.0
- eetq *
- einops *
- fastapi *
- fire *
- galore-torch *
- gradio >=4.0.0
- hqq *
- jieba *
- matplotlib >=3.7.0
- modelscope *
- nltk *
- numpy <2.0.0
- optimum >=1.17.0
- packaging *
- pandas >=2.0.0
- peft >=0.11.1
- protobuf *
- pydantic *
- pytest *
- pyyaml *
- rouge-chinese *
- ruff *
- scipy *
- sentencepiece *
- sse-starlette *
- tiktoken *
- torch ==2.1.0
- torch >=1.13.1
- torch-npu ==2.1.0.post3
- transformers >=4.41.2
- transformers_stream_generator *
- trl >=0.8.6
- uvicorn *
- vllm >=0.4.3