Skip to content

Commit

Permalink
fix: add instruction for apple sillicon installation for tensorflow-text
Browse files Browse the repository at this point in the history
  • Loading branch information
nglehuy committed May 4, 2024
1 parent 794575b commit be3d4ed
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 32 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ TensorFlowASR implements some automatic speech recognition architectures such as
- [Installing from source (recommended)](#installing-from-source-recommended)
- [Installing via PyPi](#installing-via-pypi)
- [Installing for development](#installing-for-development)
- [Install for Apple Sillicon](#install-for-apple-sillicon)
- [Running in a container](#running-in-a-container)
- [Training \& Testing Tutorial](#training--testing-tutorial)
- [Features Extraction](#features-extraction)
Expand Down Expand Up @@ -110,6 +111,19 @@ pip3 install -e ".[dev]"
pip3 install -e ".[tf2.x]" # or ".[tf2.x-gpu]" or ".[tf2.x-apple]" for apple m1 machine
```

### Install for Apple Sillicon

Due to tensorflow-text is not built for Apple Sillicon, we need to install it with the prebuilt wheel file from [sun1638650145/Libraries-and-Extensions-for-TensorFlow-for-Apple-Silicon](https://github.com/sun1638650145/Libraries-and-Extensions-for-TensorFlow-for-Apple-Silicon)

Do this after installing TensorFlowASR with tensorflow above

```bash
TF_VERSION="$(python3 -c 'import tensorflow; print(tensorflow.__version__)')" && \
TF_VERSION_MAJOR="$(echo $TF_VERSION | cut -d'.' -f1,2)" && \
URL="https://github.com/sun1638650145/Libraries-and-Extensions-for-TensorFlow-for-Apple-Silicon" && \
pip3 install "${URL}/releases/download/v${TF_VERSION_MAJOR}/tensorflow_text-${TF_VERSION_MAJOR}.0-cp310-cp310-macosx_11_0_arm64.whl"
```

### Running in a container

```bash
Expand Down
48 changes: 16 additions & 32 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,49 +20,33 @@ pydot==1.4.2
graphviz==0.20.1

# extra=tf2-12
tensorflow>=2.12.0,<2.13.0
tensorflow-text>=2.12.0,<2.13.0
tensorflow~=2.12.0
tensorflow-text~=2.12.0

# extra=tf2-12-gpu
tensorflow[and-cuda]>=2.12.0,<2.13.0
tensorflow-text>=2.12.0,<2.13.0

# extra=tf2-12-apple
tensorflow-macos>=2.12.0,<2.13.0
tensorflow-text @ https://github.com/sun1638650145/Libraries-and-Extensions-for-TensorFlow-for-Apple-Silicon/releases/download/v2.12/tensorflow_text-2.12.0-cp310-cp310-macosx_11_0_arm64.whl
tensorflow[and-cuda]~=2.12.0
tensorflow-text~=2.12.0

# extra=tf2-13
tensorflow>=2.13.0,<2.14.0
tensorflow-text>=2.13.0rc0,<2.14.0
tensorflow~=2.13.0
tensorflow-text~=2.13.0rc0

# extra=tf2-13-gpu
tensorflow[and-cuda]>=2.13.0,<2.14.0
tensorflow-text>=2.13.0rc0,<2.14.0

# extra=tf2-13-apple
tensorflow>=2.13.0,<2.14.0 # https://blog.tensorflow.org/2023/07/whats-new-in-tensorflow-213-and-keras-213.html
tensorflow-text @ https://github.com/sun1638650145/Libraries-and-Extensions-for-TensorFlow-for-Apple-Silicon/releases/download/v2.13/tensorflow_text-2.13.0-cp310-cp310-macosx_11_0_arm64.whl
tensorflow[and-cuda]~=2.13.0
tensorflow-text~=2.13.0rc0

# extra=tf2-14
tensorflow>=2.14.0,<2.15.0
tensorflow-text>=2.14.0,<2.15.0
tensorflow~=2.14.0
tensorflow-text~=2.14.0

# extra=tf2-14-gpu
tensorflow[and-cuda]>=2.14.0,<2.15.0
tensorflow-text>=2.14.0,<2.15.0

# extra=tf2-14-apple
tensorflow>=2.14.0,<2.15.0
tensorflow-text @ https://github.com/sun1638650145/Libraries-and-Extensions-for-TensorFlow-for-Apple-Silicon/releases/download/v2.14/tensorflow_text-2.14.0-cp310-cp310-macosx_11_0_arm64.whl
tensorflow[and-cuda]~=2.14.0
tensorflow-text~=2.14.0

# extra=tf2-15
tensorflow>=2.15.0,<2.16.0
tensorflow-text>=2.15.0,<2.16.0
tensorflow~=2.15.0
tensorflow-text~=2.15.0

# extra=tf2-15-gpu
tensorflow[and-cuda]>=2.15.0,<2.16.0
tensorflow-text>=2.15.0,<2.16.0

# extra=tf2-15-apple
tensorflow>=2.15.0,<2.16.0
tensorflow-text @ https://github.com/sun1638650145/Libraries-and-Extensions-for-TensorFlow-for-Apple-Silicon/releases/download/v2.15/tensorflow_text-2.15.0-cp310-cp310-macosx_11_0_arm64.whl
tensorflow[and-cuda]~=2.15.0
tensorflow-text~=2.15.0

0 comments on commit be3d4ed

Please sign in to comment.