Skip to content

Commit ce38301

Browse files
committed
clean up coreml install_requirements
1 parent 840151e commit ce38301

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

backends/apple/coreml/scripts/install_requirements.sh

+6-10
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ SCRIPT_DIR_PATH="$(
1010
pwd -P
1111
)"
1212

13+
# TODO(jathu): remove the need to fetch coremltools to build deps for coreml_executor_runner.
14+
# Keep this version in sync with: pyproject.toml
15+
COREMLTOOLS_VERSION="8.1"
16+
1317
red=`tput setaf 1`
1418
green=`tput setaf 2`
1519

@@ -24,7 +28,7 @@ rm -rf "$COREML_DIR_PATH/third-party"
2428
mkdir "$COREML_DIR_PATH/third-party"
2529

2630
echo "${green}ExecuTorch: Cloning coremltools."
27-
git clone --depth 1 --branch 8.1 "https://github.com/apple/coremltools.git" $COREMLTOOLS_DIR_PATH
31+
git clone --depth 1 --branch "${COREMLTOOLS_VERSION}" "https://github.com/apple/coremltools.git" $COREMLTOOLS_DIR_PATH
2832
cd $COREMLTOOLS_DIR_PATH
2933

3034
STATUS=$?
@@ -43,15 +47,7 @@ fi
4347

4448
mkdir "$COREMLTOOLS_DIR_PATH/build"
4549
cmake -S "$COREMLTOOLS_DIR_PATH" -B "$COREMLTOOLS_DIR_PATH/build"
46-
cmake --build "$COREMLTOOLS_DIR_PATH/build" --parallel
47-
48-
echo "${green}ExecuTorch: Cloning nlohmann."
49-
git clone https://github.com/nlohmann/json.git "$COREML_DIR_PATH/third-party/nlohmann_json"
50-
STATUS=$?
51-
if [ $STATUS -ne 0 ]; then
52-
echo "${red}ExecuTorch: Failed to clone nlohmann."
53-
exit 1
54-
fi
50+
cmake --build "$COREMLTOOLS_DIR_PATH/build" --parallel --target mlmodel
5551

5652
echo "${green}ExecuTorch: Copying protobuf files."
5753
mkdir -p "$COREML_DIR_PATH/runtime/sdk/format/"

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ dependencies=[
6767
"sympy",
6868
"tabulate",
6969
"typing-extensions",
70-
# macOS Only
70+
# Keep this version in sync with: ./backends/apple/coreml/scripts/install_requirements.sh
7171
"coremltools==8.1; platform_system == 'Darwin'",
7272
]
7373

0 commit comments

Comments
 (0)