Просмотр исходного кода

Merge pull request #373 from willschneider15/mac-intel

Getting the setup script to work on Intel based Mac machines
Alex Cheema 6 месяцев назад
Родитель
Сommit
21cdd4a014
1 измененных файлов с 9 добавлено и 7 удалено
  1. 9 7
      setup.py

+ 9 - 7
setup.py

@@ -1,4 +1,5 @@
 import sys
+import platform
 
 from setuptools import find_packages, setup
 
@@ -27,13 +28,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,8 +35,16 @@ extras_require = {
     "mypy==1.11.0",
     "yapf==0.40.2",
   ],
+  "apple_silicon": [
+    "mlx==0.18.0",
+    "mlx-lm==0.18.2",
+  ],
 }
 
+# Check if running on macOS with Apple Silicon
+if sys.platform.startswith("darwin") and platform.machine() == "arm64":
+  install_requires.extend(extras_require["apple_silicon"])
+
 setup(
   name="exo",
   version="0.0.1",