[object Object]

← back to Exo

Getting the setup script to work on Intel based Mac machines

e1ae6d5a4f7d86126cfa042015bc67173de29c09 · 2024-10-22 02:42:16 -0400 · willschneider15

Files touched

Diff

commit e1ae6d5a4f7d86126cfa042015bc67173de29c09
Author: willschneider15 <willschneider15@gmail.com>
Date:   Tue Oct 22 02:42:16 2024 -0400

    Getting the setup script to work on Intel based Mac machines
---
 install.sh | 10 +++++++++-
 setup.py   | 11 ++++-------
 2 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/install.sh b/install.sh
index ce83eed8..22efbdfa 100755
--- a/install.sh
+++ b/install.sh
@@ -2,4 +2,12 @@
 
 python3 -m venv .venv
 source .venv/bin/activate
-pip install -e .
+
+# Check if running on macOS with Apple Silicon
+if [[ "$(uname)" == "Darwin" && "$(uname -m)" == "arm64" ]]; then
+    echo "Installing with Apple Silicon support..."
+    pip install -e ".[apple_silicon]"
+else
+    echo "Installing without Apple Silicon support..."
+    pip install -e .
+fi
diff --git a/setup.py b/setup.py
index e71316b1..ae2ad3a8 100644
--- a/setup.py
+++ b/setup.py
@@ -27,13 +27,6 @@ install_requires = [
   "tinygrad @ git+https://github.com/tinygrad/tinygrad.git@232edcfd4f8b388807c64fb1817a7668ce27cbad",
 ]
 
-# Add macOS-specific packages if on Darwin (macOS)
-if sys.platform.startswith("darwin"):
-  install_requires.extend([
-    "mlx==0.18.0",
-    "mlx-lm==0.18.2",
-  ])
-
 extras_require = {
   "linting": [
     "pylint==3.2.6",
@@ -41,6 +34,10 @@ extras_require = {
     "mypy==1.11.0",
     "yapf==0.40.2",
   ],
+  "apple_silicon": [
+    "mlx==0.18.0",
+    "mlx-lm==0.18.2",
+  ],
 }
 
 setup(

← 5e474135 changes to manual_discovery config based on PR comments  ·  back to Exo  ·  changes to broadcast func 3908b97a →