Elffuss BraidHub

kikocis/mlx-vlm public

fix build error
Changeset52c77c2c9fdcdc2af1592f4f2d7fa617fc5e1dd1e1eb35bb52272ee6ab9d66dd
AuthorPrince Canuma <prince.gdt@gmail.com> · 2024-04-23 02:10 +02:00
CommitterPrince Canuma <prince.gdt@gmail.com> · 2024-04-23 02:10 +02:00
Parentsda80fb4190fd

Browse the files at this changeset

5 files changed

modified .github/workflows/python-publish.yml +1 −0
@@ -32,3 +32,4 @@
3232 with:
3333 user: __token__
3434 password: ${{ secrets.PYPI_API_TOKEN }}
35+ packages_dir: dist
deleted mlx_vlm/requirements.txt +0 −7
@@ -1,7 +0,0 @@
1-mlx>=0.8.0
2-mlx-lm>=0.4.0
3-numpy
4-transformers
5-torch
6-huggingface_hub
7-Pillow
modified mlx_vlm/version.py +0 −2
@@ -1,3 +1,1 @@
1-
2-
31 __version__ = "0.0.1"
added requirements.txt +8 −0
@@ -0,0 +1,8 @@
1+mlx>=0.8.0
2+mlx-lm>=0.4.0
3+numpy
4+transformers
5+torch
6+huggingface_hub
7+Pillow
8+requests
modified setup.py +15 −8
@@ -1,27 +1,34 @@
11 import sys
22 from pathlib import Path
3-
43 from setuptools import setup, find_packages
54
6-package_dir = Path(__file__).parent / "mlx_vlm"
7-with open(package_dir / "requirements.txt") as fid:
8- requirements = [l.strip() for l in fid.readlines()]
5+# Get the project root directory
6+root_dir = Path(__file__).parent
97
8+# Add the package directory to the Python path
9+package_dir = root_dir / "mlx_vlm"
1010 sys.path.append(str(package_dir))
11+
12+# Read the requirements from the requirements.txt file
13+requirements_path = root_dir / "requirements.txt"
14+with open(requirements_path) as fid:
15+ requirements = [l.strip() for l in fid.readlines()]
16+
17+# Import the version from the package
1118 from version import __version__
1219
20+# Setup configuration
1321 setup(
1422 name="mlx-vlm",
1523 version=__version__,
1624 description="Vision LLMs on Apple silicon with MLX and the Hugging Face Hub",
17- long_description=open("README.md", encoding="utf-8").read(),
25+ long_description=open(root_dir / "README.md", encoding="utf-8").read(),
1826 long_description_content_type="text/markdown",
19- readme="README.md",
2027 author_email="prince.gdt@gmail.com",
2128 author="MLX Contributors",
2229 url="https://github.com/Blaizzy/mlx-vlm",
2330 license="MIT",
2431 install_requires=requirements,
25- packages=find_packages(),
32+ packages=find_packages(where=root_dir),
2633 python_requires=">=3.8",
27-)
34+)
No newline at the end of the file