From 65eff9a6d1345c737927f4e336bd12c04c7a9431 Mon Sep 17 00:00:00 2001 From: Fangjun Kuang Date: Wed, 21 Feb 2024 10:51:41 +0800 Subject: [PATCH] Download ios-onnxruntime from github instead of huggingface. (#593) --- build-ios.sh | 34 +++++++++------------------------- 1 file changed, 9 insertions(+), 25 deletions(-) diff --git a/build-ios.sh b/build-ios.sh index bed00c47..5517a8b4 100755 --- a/build-ios.sh +++ b/build-ios.sh @@ -6,36 +6,20 @@ dir=build-ios mkdir -p $dir cd $dir onnxruntime_version=1.16.3 +onnxruntime_dir=ios-onnxruntime/$onnxruntime_version -if [ ! -f ios-onnxruntime/$onnxruntime_version/onnxruntime.xcframework/ios-arm64/onnxruntime.a ]; then - if [ ! -d ios-onnxruntime ]; then - GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/csukuangfj/ios-onnxruntime - fi - - pushd ios-onnxruntime - git pull - +if [ ! -f $onnxruntime_dir/onnxruntime.xcframework/ios-arm64/onnxruntime.a ]; then + mkdir -p $onnxruntime_dir + pushd $onnxruntime_dir + rm -f onnxruntime.xcframework-${onnxruntime_version}.tar.bz2 + wget https://github.com/csukuangfj/onnxruntime-libs/releases/download/v${onnxruntime_version}/onnxruntime.xcframework-${onnxruntime_version}.tar.bz2 + tar xvf onnxruntime.xcframework-${onnxruntime_version}.tar.bz2 + rm onnxruntime.xcframework-${onnxruntime_version}.tar.bz2 + cd .. ln -sf $onnxruntime_version/onnxruntime.xcframework . - git lfs pull --include $onnxruntime_version/onnxruntime.xcframework/ios-arm64/onnxruntime.a - git lfs pull --include $onnxruntime_version/onnxruntime.xcframework/ios-arm64_x86_64-simulator/onnxruntime.a popd fi -# check filesize -filesize=$(ls -l ./ios-onnxruntime/$onnxruntime_version/onnxruntime.xcframework/ios-arm64/onnxruntime.a | tr -s " " " " | cut -d " " -f 5) -if (( $filesize < 1000 )); then - ls -lh ./ios-onnxruntime/onnxruntime.xcframework/ios-arm64/onnxruntime.a - echo "Please use: git lfs pull to download ./ios-onnxruntime/$onnxruntime_version/onnxruntime.xcframework/ios-arm64/onnxruntime.a" - exit 1 -fi - -filesize=$(ls -l ./ios-onnxruntime/$onnxruntime_version/onnxruntime.xcframework/ios-arm64_x86_64-simulator/onnxruntime.a | tr -s " " " " | cut -d " " -f 5) -if (( $filesize < 1000 )); then - ls -lh ./ios-onnxruntime/$onnxruntime_version/onnxruntime.xcframework/ios-arm64_x86_64-simulator/onnxruntime.a - echo "Please use: git lfs pull to download ./ios-onnxruntime/$onnxruntime_version/onnxruntime.xcframework/ios-arm64_x86_64-simulator/onnxruntime.a" - exit 1 -fi - # First, for simulator echo "Building for simulator (x86_64)"