From ac94b006b3c6ffc93b09a632e9f6a6e97678f727 Mon Sep 17 00:00:00 2001 From: Albert Villanova del Moral <8515462+albertvillanova@users.noreply.github.com> Date: Mon, 17 Oct 2022 10:44:32 +0200 Subject: [PATCH] Install tensorflow-macos dependency conditionally --- setup.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 3581371ea33..f7743bb509d 100644 --- a/setup.py +++ b/setup.py @@ -132,7 +132,8 @@ "py7zr", "rarfile>=4.0", "s3fs>=2021.11.1", # aligned with fsspec[http]>=2021.11.1 - "tensorflow>=2.3,!=2.6.0,!=2.6.1", + "tensorflow>=2.3,!=2.6.0,!=2.6.1; sys_platform != 'darwin' or platform_machine != 'arm64'", + "tensorflow-macos; sys_platform == 'darwin' and platform_machine == 'arm64'", "torch", "torchaudio<0.12.0", "soundfile", @@ -172,7 +173,10 @@ "audio": AUDIO_REQUIRE, "vision": VISION_REQURE, "apache-beam": ["apache-beam>=2.26.0"], - "tensorflow": ["tensorflow>=2.2.0,!=2.6.0,!=2.6.1"], + "tensorflow": [ + "tensorflow>=2.2.0,!=2.6.0,!=2.6.1; sys_platform != 'darwin' or platform_machine != 'arm64'", + "tensorflow-macos; sys_platform == 'darwin' and platform_machine == 'arm64'", + ], "tensorflow_gpu": ["tensorflow-gpu>=2.2.0,!=2.6.0,!=2.6.1"], "torch": ["torch"], "s3": [