mirror of
https://github.com/ml-explore/mlx-examples.git
synced 2025-08-29 18:26:37 +08:00
FLUX: add setup config
This commit is contained in:
parent
e61849a003
commit
1c43a83280
@ -1,5 +1,6 @@
|
||||
# Copyright © 2024 Apple Inc.
|
||||
|
||||
from ._version import __version__
|
||||
from .datasets import Dataset, load_dataset
|
||||
from .flux import FluxPipeline
|
||||
from .lora import LoRALinear
|
||||
|
3
flux/mlx_flux/_version.py
Normal file
3
flux/mlx_flux/_version.py
Normal file
@ -0,0 +1,3 @@
|
||||
# Copyright © 2023-2024 Apple Inc.
|
||||
|
||||
__version__ = "0.1.0"
|
61
flux/setup.py
Normal file
61
flux/setup.py
Normal file
@ -0,0 +1,61 @@
|
||||
# Copyright © 2024 Apple Inc.
|
||||
|
||||
import os
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
from setuptools import find_namespace_packages, setup
|
||||
|
||||
# 获取当前文件的父目录(项目根目录)
|
||||
ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
package_dir = os.path.join(ROOT_DIR, "mlx_flux")
|
||||
|
||||
# 定义依赖列表
|
||||
requirements = []
|
||||
if os.path.exists(os.path.join(ROOT_DIR, "requirements.txt")):
|
||||
with open(os.path.join(ROOT_DIR, "requirements.txt")) as fid:
|
||||
requirements = [l.strip() for l in fid.readlines() if l.strip()]
|
||||
|
||||
# 添加包路径
|
||||
sys.path.append(package_dir)
|
||||
|
||||
from _version import __version__
|
||||
|
||||
try:
|
||||
with open(os.path.join(ROOT_DIR, "README.md"), encoding="utf-8") as f:
|
||||
long_description = f.read()
|
||||
except FileNotFoundError:
|
||||
long_description = "FLUX.1 on Apple silicon with MLX and the Hugging Face Hub"
|
||||
|
||||
setup(
|
||||
name="mlx-flux",
|
||||
version=__version__,
|
||||
description="FLUX.1 on Apple silicon with MLX and the Hugging Face Hub",
|
||||
long_description=open("README.md", encoding="utf-8").read(),
|
||||
long_description_content_type="text/markdown",
|
||||
readme="README.md",
|
||||
author_email="mlx@group.apple.com",
|
||||
author="MLX Contributors",
|
||||
url="https://github.com/ml-explore/mlx-examples",
|
||||
license="MIT",
|
||||
install_requires=requirements,
|
||||
|
||||
# Package configuration
|
||||
packages=find_namespace_packages(include=["mlx_flux", "mlx_flux.*"]), # 明确指定包含的包
|
||||
package_data={
|
||||
"mlx_flux": ["*.py"],
|
||||
},
|
||||
include_package_data=True,
|
||||
|
||||
python_requires=">=3.8",
|
||||
entry_points={
|
||||
"console_scripts": [
|
||||
# generate images
|
||||
"mlx_flux.generate = mlx_flux.txt2image:main",
|
||||
"mlx_flux.txt2image = mlx_flux.txt2image:main",
|
||||
# fine-tuning model
|
||||
"mlx_flux.lora = mlx_flux.dreambooth:main",
|
||||
"mlx_flux.dreambooth = mlx_flux.dreambooth:main",
|
||||
]
|
||||
},
|
||||
)
|
Loading…
Reference in New Issue
Block a user