-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Static dependency pyproject.toml proposal
#9337
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,135 @@ | ||||||||||||||
| [build-system] | ||||||||||||||
| requires = ["setuptools>=68", "wheel"] | ||||||||||||||
| build-backend = "setuptools.build_meta" | ||||||||||||||
|
|
||||||||||||||
| [project] | ||||||||||||||
| name = "ms_swift" | ||||||||||||||
| dynamic = ["version", "readme"] | ||||||||||||||
| description = "Swift: Scalable lightWeight Infrastructure for Fine-Tuning" | ||||||||||||||
| requires-python = ">=3.8" | ||||||||||||||
| license = { text = "Apache License 2.0" } | ||||||||||||||
| authors = [ | ||||||||||||||
| { name = "DAMO ModelScope teams", email = "contact@modelscope.cn" }, | ||||||||||||||
| ] | ||||||||||||||
| keywords = ["transformers", "LLM", "lora", "megatron", "grpo", "sft"] | ||||||||||||||
| classifiers = [ | ||||||||||||||
| "Development Status :: 4 - Beta", | ||||||||||||||
| "License :: OSI Approved :: Apache Software License", | ||||||||||||||
| "Operating System :: OS Independent", | ||||||||||||||
| "Programming Language :: Python :: 3", | ||||||||||||||
| "Programming Language :: Python :: 3.8", | ||||||||||||||
| "Programming Language :: Python :: 3.9", | ||||||||||||||
| "Programming Language :: Python :: 3.10", | ||||||||||||||
| "Programming Language :: Python :: 3.11", | ||||||||||||||
| "Programming Language :: Python :: 3.12", | ||||||||||||||
| ] | ||||||||||||||
| dependencies = [ | ||||||||||||||
| "accelerate", | ||||||||||||||
| "addict; python_version>='3.10'", | ||||||||||||||
| "aiohttp", | ||||||||||||||
| "attrdict; python_version<'3.10'", | ||||||||||||||
| "binpacking", | ||||||||||||||
| "charset_normalizer", | ||||||||||||||
| "cpm_kernels", | ||||||||||||||
| "dacite", | ||||||||||||||
| "datasets>=3.0,<4.8.5; python_version>='3.9'", | ||||||||||||||
| "datasets>=2.0,<3; python_version<'3.9'", | ||||||||||||||
| "einops", | ||||||||||||||
| "fastapi", | ||||||||||||||
| "gradio>=3.40.0,<6.0", | ||||||||||||||
| "importlib-metadata; python_version<'3.10'", | ||||||||||||||
| "json_repair", | ||||||||||||||
| "matplotlib", | ||||||||||||||
| "modelscope>=1.23", | ||||||||||||||
| "nltk", | ||||||||||||||
| "numpy", | ||||||||||||||
| "openai", | ||||||||||||||
| "oss2", | ||||||||||||||
| "pandas", | ||||||||||||||
| "peft>=0.11,<0.20", | ||||||||||||||
| "pillow", | ||||||||||||||
| "PyYAML>=5.4", | ||||||||||||||
| "requests", | ||||||||||||||
| "rouge", | ||||||||||||||
| "safetensors", | ||||||||||||||
| "scipy", | ||||||||||||||
| "sentencepiece", | ||||||||||||||
| "simplejson>=3.3.0", | ||||||||||||||
| "sortedcontainers>=1.5.9", | ||||||||||||||
| "tensorboard", | ||||||||||||||
| "tiktoken", | ||||||||||||||
| "tqdm", | ||||||||||||||
| "transformers>=4.33,<5.9.0", | ||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||||||||||
| "transformers_stream_generator", | ||||||||||||||
| "trl>=0.15,<1.0; python_version>='3.10'", | ||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Including
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The
Suggested change
|
||||||||||||||
| "uvicorn", | ||||||||||||||
| "zstandard", | ||||||||||||||
| ] | ||||||||||||||
|
Comment on lines
+26
to
+67
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hardcoding a static list of dependencies in |
||||||||||||||
|
|
||||||||||||||
| [project.optional-dependencies] | ||||||||||||||
| all = [ | ||||||||||||||
| "evalscope[opencompass,vlmeval]>=1.0.0; python_version>='3.10'", | ||||||||||||||
| "swanlab", | ||||||||||||||
| "ray", | ||||||||||||||
| ] | ||||||||||||||
| eval = [ | ||||||||||||||
| "evalscope[opencompass,vlmeval]>=1.0.0; python_version>='3.10'", | ||||||||||||||
| ] | ||||||||||||||
| swanlab = [ | ||||||||||||||
| "swanlab", | ||||||||||||||
| ] | ||||||||||||||
| ray = [ | ||||||||||||||
| "ray", | ||||||||||||||
| ] | ||||||||||||||
| megatron = [ | ||||||||||||||
| "mcore-bridge>=1.2.0; python_version>='3.12'", | ||||||||||||||
| "megatron-core>=0.15; python_version>='3.12'", | ||||||||||||||
| "peft>=0.15; python_version>='3.12'", | ||||||||||||||
|
Comment on lines
+85
to
+87
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The
Comment on lines
+85
to
+87
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The Python version restriction
Suggested change
|
||||||||||||||
| ] | ||||||||||||||
| tests = [ | ||||||||||||||
| "expecttest", | ||||||||||||||
| "flake8", | ||||||||||||||
| "isort>=4.3.21", | ||||||||||||||
| "pre-commit", | ||||||||||||||
| "yapf==0.30.0", | ||||||||||||||
| ] | ||||||||||||||
| docs = [ | ||||||||||||||
| "docutils>=0.16.0", | ||||||||||||||
| "myst_parser", | ||||||||||||||
| "recommonmark", | ||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||||||||||
| "sphinx>=5.3.0", | ||||||||||||||
| "sphinx-book-theme", | ||||||||||||||
| "sphinx-copybutton", | ||||||||||||||
| "sphinx-rtd-theme", | ||||||||||||||
| "sphinx_markdown_tables", | ||||||||||||||
| "sphinxcontrib-mermaid", | ||||||||||||||
| ] | ||||||||||||||
|
|
||||||||||||||
| [project.urls] | ||||||||||||||
| Homepage = "https://github.com/modelscope/ms-swift" | ||||||||||||||
|
|
||||||||||||||
| [project.scripts] | ||||||||||||||
| swift = "swift.cli.main:cli_main" | ||||||||||||||
| megatron = "swift.cli._megatron.main:cli_main" | ||||||||||||||
|
|
||||||||||||||
| [tool.setuptools] | ||||||||||||||
| include-package-data = true | ||||||||||||||
| zip-safe = false | ||||||||||||||
|
|
||||||||||||||
| [tool.setuptools.packages.find] | ||||||||||||||
| exclude = ["tests", "tests.*"] | ||||||||||||||
|
|
||||||||||||||
| [tool.setuptools.package-data] | ||||||||||||||
| "*" = [ | ||||||||||||||
| "utils/*", | ||||||||||||||
| "dataset/data/*.*", | ||||||||||||||
| "config/*.json", | ||||||||||||||
| "loss_scale/config/*.json", | ||||||||||||||
| ] | ||||||||||||||
|
|
||||||||||||||
| [tool.setuptools.dynamic] | ||||||||||||||
| version = { attr = "swift.version.__version__" } | ||||||||||||||
| readme = { file = ["README.md"], content-type = "text/markdown" } | ||||||||||||||
|
|
||||||||||||||
| [tool.uv] | ||||||||||||||
| package = true | ||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The upper bound
<4.8.5fordatasetsseems arbitrary. Sincedatasetsis currently on version 3.x, using a major version bound like<4.0.0is more standard and avoids confusion with specific patch versions that do not yet exist.