Skip to content

Commit be3d4ed

Browse files
committed
fix: add instruction for apple sillicon installation for tensorflow-text
1 parent 794575b commit be3d4ed

File tree

2 files changed

+30
-32
lines changed

2 files changed

+30
-32
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ TensorFlowASR implements some automatic speech recognition architectures such as
3434
- [Installing from source (recommended)](#installing-from-source-recommended)
3535
- [Installing via PyPi](#installing-via-pypi)
3636
- [Installing for development](#installing-for-development)
37+
- [Install for Apple Sillicon](#install-for-apple-sillicon)
3738
- [Running in a container](#running-in-a-container)
3839
- [Training \& Testing Tutorial](#training--testing-tutorial)
3940
- [Features Extraction](#features-extraction)
@@ -110,6 +111,19 @@ pip3 install -e ".[dev]"
110111
pip3 install -e ".[tf2.x]" # or ".[tf2.x-gpu]" or ".[tf2.x-apple]" for apple m1 machine
111112
```
112113

114+
### Install for Apple Sillicon
115+
116+
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)
117+
118+
Do this after installing TensorFlowASR with tensorflow above
119+
120+
```bash
121+
TF_VERSION="$(python3 -c 'import tensorflow; print(tensorflow.__version__)')" && \
122+
TF_VERSION_MAJOR="$(echo $TF_VERSION | cut -d'.' -f1,2)" && \
123+
URL="https://github.com/sun1638650145/Libraries-and-Extensions-for-TensorFlow-for-Apple-Silicon" && \
124+
pip3 install "${URL}/releases/download/v${TF_VERSION_MAJOR}/tensorflow_text-${TF_VERSION_MAJOR}.0-cp310-cp310-macosx_11_0_arm64.whl"
125+
```
126+
113127
### Running in a container
114128

115129
```bash

requirements.txt

Lines changed: 16 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -20,49 +20,33 @@ pydot==1.4.2
2020
graphviz==0.20.1
2121

2222
# extra=tf2-12
23-
tensorflow>=2.12.0,<2.13.0
24-
tensorflow-text>=2.12.0,<2.13.0
23+
tensorflow~=2.12.0
24+
tensorflow-text~=2.12.0
2525

2626
# extra=tf2-12-gpu
27-
tensorflow[and-cuda]>=2.12.0,<2.13.0
28-
tensorflow-text>=2.12.0,<2.13.0
29-
30-
# extra=tf2-12-apple
31-
tensorflow-macos>=2.12.0,<2.13.0
32-
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
27+
tensorflow[and-cuda]~=2.12.0
28+
tensorflow-text~=2.12.0
3329

3430
# extra=tf2-13
35-
tensorflow>=2.13.0,<2.14.0
36-
tensorflow-text>=2.13.0rc0,<2.14.0
31+
tensorflow~=2.13.0
32+
tensorflow-text~=2.13.0rc0
3733

3834
# extra=tf2-13-gpu
39-
tensorflow[and-cuda]>=2.13.0,<2.14.0
40-
tensorflow-text>=2.13.0rc0,<2.14.0
41-
42-
# extra=tf2-13-apple
43-
tensorflow>=2.13.0,<2.14.0 # https://blog.tensorflow.org/2023/07/whats-new-in-tensorflow-213-and-keras-213.html
44-
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
35+
tensorflow[and-cuda]~=2.13.0
36+
tensorflow-text~=2.13.0rc0
4537

4638
# extra=tf2-14
47-
tensorflow>=2.14.0,<2.15.0
48-
tensorflow-text>=2.14.0,<2.15.0
39+
tensorflow~=2.14.0
40+
tensorflow-text~=2.14.0
4941

5042
# extra=tf2-14-gpu
51-
tensorflow[and-cuda]>=2.14.0,<2.15.0
52-
tensorflow-text>=2.14.0,<2.15.0
53-
54-
# extra=tf2-14-apple
55-
tensorflow>=2.14.0,<2.15.0
56-
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
43+
tensorflow[and-cuda]~=2.14.0
44+
tensorflow-text~=2.14.0
5745

5846
# extra=tf2-15
59-
tensorflow>=2.15.0,<2.16.0
60-
tensorflow-text>=2.15.0,<2.16.0
47+
tensorflow~=2.15.0
48+
tensorflow-text~=2.15.0
6149

6250
# extra=tf2-15-gpu
63-
tensorflow[and-cuda]>=2.15.0,<2.16.0
64-
tensorflow-text>=2.15.0,<2.16.0
65-
66-
# extra=tf2-15-apple
67-
tensorflow>=2.15.0,<2.16.0
68-
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
51+
tensorflow[and-cuda]~=2.15.0
52+
tensorflow-text~=2.15.0

0 commit comments

Comments
 (0)