pyproject.toml 3.5 KB
Newer Older
Rayyyyy's avatar
V0.6.3  
Rayyyyy committed
1
[build-system]
shihm's avatar
uodata  
shihm committed
2
3
requires = ["hatchling"]
build-backend = "hatchling.build"
Rayyyyy's avatar
V0.6.3  
Rayyyyy committed
4

chenych's avatar
chenych committed
5
6
[project]
name = "llamafactory"
shihm's avatar
uodata  
shihm committed
7
8
9
10
11
12
13
dynamic = ["version"]
description = "Unified Efficient Fine-Tuning of 100+ LLMs"
readme = "README.md"
license = "Apache-2.0"
requires-python = ">=3.11.0"
authors = [
    { name = "hiyouga", email = "hiyouga@buaa.edu.cn" }
chenych's avatar
chenych committed
14
]
shihm's avatar
uodata  
shihm committed
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
keywords = [
    "AI",
    "LLM",
    "GPT",
    "ChatGPT",
    "Llama",
    "Transformer",
    "DeepSeek",
    "Pytorch"
]
classifiers = [
    "Development Status :: 4 - Beta",
    "Intended Audience :: Developers",
    "Intended Audience :: Education",
    "Intended Audience :: Science/Research",
    "License :: OSI Approved :: Apache Software License",
    "Operating System :: OS Independent",
    "Programming Language :: Python :: 3",
    "Programming Language :: Python :: 3.10",
    "Programming Language :: Python :: 3.11",
    "Programming Language :: Python :: 3.12",
    "Programming Language :: Python :: 3.13",
    "Topic :: Scientific/Engineering :: Artificial Intelligence"
]
dependencies = [
    # core deps
    "torch>=2.4.0",
    "torchvision>=0.19.0",
    "torchaudio>=2.4.0",
    "transformers>=4.51.0,<=4.57.1,!=4.52.0,!=4.57.0",
    "datasets>=2.16.0,<=4.0.0",
    "accelerate>=1.3.0,<=1.11.0",
    "peft>=0.14.0,<=0.17.1",
    "trl>=0.18.0,<=0.24.0",
    "torchdata>=0.10.0,<=0.11.0",
    # gui
    "gradio>=4.38.0,<=5.50.0",
    "matplotlib>=3.7.0",
    "tyro<0.9.0",
    # ops
    "einops",
    "numpy",
    "pandas",
    "scipy",
    # model and tokenizer
    "sentencepiece",
    "tiktoken",
    "modelscope",
    "hf-transfer",
    "safetensors",
    # python
    "av",
    "fire",
    "omegaconf",
    "packaging",
    "protobuf",
    "pyyaml",
    "pydantic",
    # api
    "uvicorn",
    "fastapi",
    "sse-starlette"
]

[project.optional-dependencies]
dev = ["pre-commit", "ruff", "pytest", "build"]
metrics = ["nltk", "jieba", "rouge-chinese"]
deepspeed = ["deepspeed>=0.10.0,<=0.16.9"]

[project.scripts]
llamafactory-cli = "llamafactory.cli:main"
lmf = "llamafactory.cli:main"

[project.urls]
Homepage = "https://github.com/hiyouga/LLaMA-Factory"
Repository = "https://github.com/hiyouga/LLaMA-Factory"

[tool.hatch.build.targets.wheel]
packages = ["src/llamafactory"]

[tool.hatch.version]
path = "src/llamafactory/extras/env.py"
pattern = "VERSION = \"(?P<version>[^\"]+)\""
chenych's avatar
chenych committed
98

Rayyyyy's avatar
V0.6.3  
Rayyyyy committed
99
[tool.ruff]
shihm's avatar
uodata  
shihm committed
100
target-version = "py311"
Rayyyyy's avatar
V0.6.3  
Rayyyyy committed
101
102
103
104
line-length = 119
indent-width = 4

[tool.ruff.lint]
chenych's avatar
chenych committed
105
ignore = [
shihm's avatar
uodata  
shihm committed
106
107
108
109
110
111
112
113
114
115
116
117
118
119
    "C408",  # collection
    "C901",  # complex
    "E501",  # line too long
    "E731",  # lambda function
    "E741",  # ambiguous var name
    "UP007", # no upgrade union
    "UP045", # no upgrade optional
    "D100",  # no doc public module
    "D101",  # no doc public class
    "D102",  # no doc public method
    "D103",  # no doc public function
    "D104",  # no doc public package
    "D105",  # no doc magic method
    "D107",  # no doc __init__
chenych's avatar
chenych committed
120
121
122
123
124
125
126
127
128
129
130
131
]
extend-select = [
    "C",      # complexity
    "E",      # error
    "F",      # pyflakes
    "I",      # isort
    "W",      # warning
    "UP",     # pyupgrade
    "D",      # pydocstyle
    "PT009",  # pytest assert
    "RUF022", # sort __all__
]
Rayyyyy's avatar
V0.6.3  
Rayyyyy committed
132
133
134

[tool.ruff.lint.isort]
lines-after-imports = 2
chenych's avatar
chenych committed
135
known-first-party = ["llamafactory"]
Rayyyyy's avatar
V0.6.3  
Rayyyyy committed
136
137
138
139
140
141
142
143
known-third-party = [
    "accelerate",
    "datasets",
    "gradio",
    "numpy",
    "peft",
    "torch",
    "transformers",
chenych's avatar
chenych committed
144
    "trl",
Rayyyyy's avatar
V0.6.3  
Rayyyyy committed
145
146
]

chenych's avatar
chenych committed
147
148
149
[tool.ruff.lint.pydocstyle]
convention = "google"

Rayyyyy's avatar
V0.6.3  
Rayyyyy committed
150
151
152
153
154
155
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
docstring-code-format = true
skip-magic-trailing-comma = false
line-ending = "auto"