Explorar o código

Getting the setup script to work on Intel based Mac machines

willschneider15 hai 6 meses
pai
achega
e1ae6d5a4f
Modificáronse 2 ficheiros con 13 adicións e 8 borrados
  1. 9 1
      install.sh
  2. 4 7
      setup.py

+ 9 - 1
install.sh

@@ -2,4 +2,12 @@
 
 
 python3 -m venv .venv
 python3 -m venv .venv
 source .venv/bin/activate
 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

+ 4 - 7
setup.py

@@ -27,13 +27,6 @@ install_requires = [
   "tinygrad @ git+https://github.com/tinygrad/tinygrad.git@232edcfd4f8b388807c64fb1817a7668ce27cbad",
   "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 = {
 extras_require = {
   "linting": [
   "linting": [
     "pylint==3.2.6",
     "pylint==3.2.6",
@@ -41,6 +34,10 @@ extras_require = {
     "mypy==1.11.0",
     "mypy==1.11.0",
     "yapf==0.40.2",
     "yapf==0.40.2",
   ],
   ],
+  "apple_silicon": [
+    "mlx==0.18.0",
+    "mlx-lm==0.18.2",
+  ],
 }
 }
 
 
 setup(
 setup(