Skip to content

fix(setup): install either tensorflow-macos or tensorflow depending on platform processor #124

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import os
from datetime import date
from setuptools import find_packages, setup
import sys

# We don't declare our dependency on transformers here because we build with
# different packages for different variants
Expand Down Expand Up @@ -61,7 +62,15 @@
extras["torch"] = ["torch>=1.8.0", "torchaudio"]

# TODO: Remove upper bound of TF 2.11 once transformers release contains this fix: https://github.com/huggingface/evaluate/pull/372
extras["tensorflow"] = ["tensorflow>=2.4.0,<2.11"]
if sys.platform == "darwin":
import platform
if platform.processor() == "arm":
tensorflow_versions = ["tensorflow-macos>=2.4.0,<2.11"]
else:
tensorflow_versions = ["tensorflow>=2.4.0,<2.11"]
extras["tensorflow"] = tensorflow_versions
else:
extras["tensorflow"] = ["tensorflow>=2.4.0,<2.11"]

# MMS Server dependencies
extras["mms"] = ["multi-model-server>=1.1.4", "retrying"]
Expand Down