Spaces:
Running
Running
ci : add coreml job that converts base.en to coreml [no ci] (#2981)
Browse files* ci : add coreml job that converts base.en to coreml [no ci]
This commit adds a new job to the CI pipeline that downloads the base.en
model and converts it to CoreML format. The CoreML model is then packed
into a zip file and uploaded as an artifact.
This will only be done for pushes to master, releases, or pre-releases.
Refs: https://github.com/ggerganov/whisper.cpp/issues/2783
* coreml : remove publishing of coreml model
* ci : add GGML_OPENMP=OFF to ubuntu-22-gcc-sanitized
- .github/workflows/build.yml +31 -1
.github/workflows/build.yml
CHANGED
|
@@ -367,7 +367,9 @@ jobs:
|
|
| 367 |
set -e
|
| 368 |
apt update
|
| 369 |
apt install -y build-essential cmake git
|
| 370 |
-
cmake . -DCMAKE_BUILD_TYPE=Debug
|
|
|
|
|
|
|
| 371 |
make
|
| 372 |
ctest -L gh --output-on-failure'
|
| 373 |
|
|
@@ -1119,3 +1121,31 @@ jobs:
|
|
| 1119 |
});
|
| 1120 |
}
|
| 1121 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 367 |
set -e
|
| 368 |
apt update
|
| 369 |
apt install -y build-essential cmake git
|
| 370 |
+
cmake . -DCMAKE_BUILD_TYPE=Debug \
|
| 371 |
+
-DWHISPER_SANITIZE_${{ matrix.sanitizer }}=ON \
|
| 372 |
+
-DGGML_OPENMP=OFF
|
| 373 |
make
|
| 374 |
ctest -L gh --output-on-failure'
|
| 375 |
|
|
|
|
| 1121 |
});
|
| 1122 |
}
|
| 1123 |
}
|
| 1124 |
+
|
| 1125 |
+
coreml-base-en:
|
| 1126 |
+
if: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/master') ||
|
| 1127 |
+
github.event.inputs.create_release == 'true' ||
|
| 1128 |
+
github.event.inputs.pre_release_tag != '' }}
|
| 1129 |
+
runs-on: macos-latest
|
| 1130 |
+
needs: determine-tag
|
| 1131 |
+
|
| 1132 |
+
steps:
|
| 1133 |
+
- name: Checkout code
|
| 1134 |
+
uses: actions/checkout@v4
|
| 1135 |
+
|
| 1136 |
+
- name: Set environment variables
|
| 1137 |
+
id: set_vars
|
| 1138 |
+
run: |
|
| 1139 |
+
echo "MODEL_NAME=base.en" >> $GITHUB_ENV
|
| 1140 |
+
echo "GEN_MODEL_NAME=whisper-${{ needs.determine-tag.outputs.tag_name }}-ggml-base.en-encoder.mlmodelc" >> $GITHUB_ENV
|
| 1141 |
+
|
| 1142 |
+
- name: Download model
|
| 1143 |
+
run: |
|
| 1144 |
+
./models/download-ggml-model.sh ${{ env.MODEL_NAME }}
|
| 1145 |
+
|
| 1146 |
+
- name: Generate CoreML model
|
| 1147 |
+
run: |
|
| 1148 |
+
python3.11 -m venv venv
|
| 1149 |
+
source venv/bin/activate
|
| 1150 |
+
pip install ane_transformers openai-whisper coremltools
|
| 1151 |
+
./models/generate-coreml-model.sh ${{ env.MODEL_NAME }}
|