Skip to content

Commit 42f27b9

Browse files
committed
Download wheel and clib for Windows
1 parent 2de2d0f commit 42f27b9

1 file changed

Lines changed: 20 additions & 12 deletions

File tree

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
#!/bin/bash
2-
set -eu
2+
set -e
33

44
DOWNLOAD_FOLDER="$1"
5-
DOWNLOADED_FILE="tensorflow.zip" # TODO extract name from wheel url, change .whl to .zip
65

76
case ${PLATFORM:-} in
87
'linux-x86_64')
9-
DOWNLOAD_URL='https://files.pythonhosted.org/packages/57/bf/03debeeaeca996543478db89c8729a40dcb97a6be811804f4a08c8e1c75a/tensorflow_cpu-2.14.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl'
8+
WHEEL_URL='https://files.pythonhosted.org/packages/57/bf/03debeeaeca996543478db89c8729a40dcb97a6be811804f4a08c8e1c75a/tensorflow_cpu-2.14.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl'
109
;;
1110
'linux-x86_64-gpu')
12-
DOWNLOAD_URL='https://files.pythonhosted.org/packages/09/63/25e76075081ea98ec48f23929cefee58be0b42212e38074a9ec5c19e838c/tensorflow-2.14.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl'
11+
WHEEL_URL='https://files.pythonhosted.org/packages/09/63/25e76075081ea98ec48f23929cefee58be0b42212e38074a9ec5c19e838c/tensorflow-2.14.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl'
1312
;;
1413
'macosx-x86_64')
15-
DOWNLOAD_URL='https://files.pythonhosted.org/packages/ad/e2/ff29a5e514ec25470b59e5d0134f08f75bd28d6ec6941a22bea6b78cb2fb/tensorflow_cpu-2.14.0-cp311-cp311-macosx_10_15_x86_64.whl'
14+
WHEEL_URL='https://files.pythonhosted.org/packages/ad/e2/ff29a5e514ec25470b59e5d0134f08f75bd28d6ec6941a22bea6b78cb2fb/tensorflow_cpu-2.14.0-cp311-cp311-macosx_10_15_x86_64.whl'
1615
;;
1716
'macosx-arm64')
18-
DOWNLOAD_URL='https://files.pythonhosted.org/packages/d3/4b/ae9037ea22ba94eb2cf267e991384c3444f3e6142fa49923352b4ab73e14/tensorflow_macos-2.14.0-cp311-cp311-macosx_12_0_arm64.whl'
17+
WHEEL_URL='https://files.pythonhosted.org/packages/d3/4b/ae9037ea22ba94eb2cf267e991384c3444f3e6142fa49923352b4ab73e14/tensorflow_macos-2.14.0-cp311-cp311-macosx_12_0_arm64.whl'
1918
;;
2019
'windows-x86_64')
21-
DOWNLOAD_URL='https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-windows-x86_64-2.14.0.zip'
20+
WHEEL_URL='https://files.pythonhosted.org/packages/ad/6e/1bfe367855dd87467564f7bf9fa14f3b17889988e79598bc37bf18f5ffb6/tensorflow_intel-2.14.0-cp311-cp311-win_amd64.whl'
21+
CLIB_URL='https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-windows-x86_64-2.14.0.zip'
2222
;;
2323
*)
2424
echo "TensorFlow distribution for ${PLATFORM} is not supported for download"
@@ -28,12 +28,20 @@ esac
2828
mkdir -p "$DOWNLOAD_FOLDER"
2929
cd "$DOWNLOAD_FOLDER"
3030

31-
if [ ! -f $DOWNLOADED_FILE ]; then
32-
curl -L $DOWNLOAD_URL --output $DOWNLOADED_FILE
31+
if [[ -n "$WHEEL_URL" ]]; then
32+
if [ ! -f 'tensorflow.whl' ]; then
33+
curl -L $WHEEL_URL --output 'tensorflow.whl'
34+
fi
35+
unzip -q -u 'tensorflow.whl'
36+
fi
37+
38+
if [[ -n "$CLIB_URL" ]]; then
39+
if [ ! -f 'tensorflow_c.zip' ]; then
40+
curl -L $CLIB_URL --output 'tensorflow_c.zip'
41+
fi
42+
unzip -q -u -d tensorflow 'tensorflow_c.zip'
3343
fi
34-
unzip -q -u $DOWNLOADED_FILE
3544

36-
mkdir -p tensorflow
3745
cd tensorflow
3846
if [[ "$PLATFORM" =~ "linux" ]]; then
3947
ln -fs libtensorflow_cc.so.2 libtensorflow_cc.so
@@ -42,6 +50,6 @@ elif [[ "$PLATFORM" =~ "macosx" ]]; then
4250
ln -fs libtensorflow_cc.2.dylib libtensorflow_cc.dylib
4351
ln -fs libtensorflow_framework.2.dylib libtensorflow_framework.dylib
4452
elif [[ "$PLATFORM" =~ "windows" ]]; then
45-
ln -fs ../lib/tensorflow.dll tensorflow.dll
53+
ln -fs lib/tensorflow.dll tensorflow.dll
4654
fi
4755
ls -l .

0 commit comments

Comments
 (0)