From 5e5d2280da1194a42d771e4b220daf94cdfee247 Mon Sep 17 00:00:00 2001 From: Aryan Date: Sat, 8 Mar 2025 00:49:59 +0530 Subject: [PATCH] PyPI package (#298) * update * Update README.md --- Makefile | 2 +- README.md | 2 +- setup.py | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 setup.py diff --git a/Makefile b/Makefile index c595ada..04d98b6 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ .PHONY: quality style -check_dirs := finetrainers tests examples train.py +check_dirs := finetrainers tests examples train.py setup.py quality: ruff check $(check_dirs) --exclude examples/_legacy diff --git a/README.md b/README.md index 052d7d4..a59914d 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # finetrainers 🧪 -FineTrainers is a work-in-progress library to support (accessible) training of video models. Our first priority is to support LoRA training for all popular video models in [Diffusers](https://github.com/huggingface/diffusers), and eventually other methods like controlnets, control-loras, distillation, etc. +Finetrainers is a work-in-progress library to support (accessible) training of diffusion models. Our first priority is to support LoRA training for all popular video models in [Diffusers](https://github.com/huggingface/diffusers), and eventually other methods like controlnets, control-loras, distillation, etc. `cogvideox-factory` was renamed to `finetrainers`. If you're looking to train CogVideoX or Mochi with the legacy training scripts, please refer to [this](./training/README.md) README instead. Everything in the `training/` directory will be eventually moved and supported under `finetrainers`. diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..4ecb1c6 --- /dev/null +++ b/setup.py @@ -0,0 +1,46 @@ +from setuptools import find_packages, setup + + +with open("README.md", "r", encoding="utf-8") as file: + long_description = file.read() + +with open("requirements.txt", "r", encoding="utf-8") as file: + requirements = [line for line in file.read().splitlines() if len(line) > 0] + +setup( + name="finetrainers", + version="0.0.1", + description="Finetrainers is a work-in-progress library to support (accessible) training of diffusion models", + long_description=long_description, + long_description_content_type="text/markdown", + author="Aryan V S", + author_email="contact.aryanvs@gmail.com", + url="https://github.com/a-r-r-o-w/finetrainers", + python_requires=">=3.8.0", + license="Apache-2.0", + packages=find_packages(), + install_requires=requirements, + extras_require={"dev": ["pytest==8.3.2", "ruff==0.1.5"]}, + classifiers=[ + "Development Status :: 1 - Planning", + "Intended Audience :: Science/Research", + "Intended Audience :: Developers", + "Intended Audience :: Education", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Operating System :: Microsoft :: Windows", + "Operating System :: Unix", + "License :: OSI Approved :: MIT License", + "Topic :: Scientific/Engineering :: Artificial Intelligence", + ], +) + +# Steps to publish: +# 1. Update version in setup.py +# 2. python setup.py sdist bdist_wheel +# 3. Check if everything works with testpypi: +# twine upload --repository testpypi dist/* +# 4. Upload to pypi: +# twine upload dist/*