Skip to content

Commit d201a39

Browse files
Install tensorflow-macos dependency conditionally (huggingface#5124)
1 parent 28bcb2f commit d201a39

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

setup.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,8 @@
132132
"py7zr",
133133
"rarfile>=4.0",
134134
"s3fs>=2021.11.1", # aligned with fsspec[http]>=2021.11.1
135-
"tensorflow>=2.3,!=2.6.0,!=2.6.1",
135+
"tensorflow>=2.3,!=2.6.0,!=2.6.1; sys_platform != 'darwin' or platform_machine != 'arm64'",
136+
"tensorflow-macos; sys_platform == 'darwin' and platform_machine == 'arm64'",
136137
"torch",
137138
"torchaudio<0.12.0",
138139
"soundfile",
@@ -172,7 +173,10 @@
172173
"audio": AUDIO_REQUIRE,
173174
"vision": VISION_REQURE,
174175
"apache-beam": ["apache-beam>=2.26.0"],
175-
"tensorflow": ["tensorflow>=2.2.0,!=2.6.0,!=2.6.1"],
176+
"tensorflow": [
177+
"tensorflow>=2.2.0,!=2.6.0,!=2.6.1; sys_platform != 'darwin' or platform_machine != 'arm64'",
178+
"tensorflow-macos; sys_platform == 'darwin' and platform_machine == 'arm64'",
179+
],
176180
"tensorflow_gpu": ["tensorflow-gpu>=2.2.0,!=2.6.0,!=2.6.1"],
177181
"torch": ["torch"],
178182
"s3": [

0 commit comments

Comments
 (0)