Skip to content

Commit f76c650

Browse files
committed
Merge remote-tracking branch 'ggerganov/master'
* ggerganov/master: (72 commits) ci : use selective copy for musa image (ggml-org#3296) ci: set fail-fast to false in docker.yml (ggml-org#3294) ruby : add Whisper::VERSION (ggml-org#3292) whisper : add version function (ggml-org#3289) ci : add should_release variable (ggml-org#3288) docs : add cmake "-j" flag in README.md (ggml-org#3284) ci : add support for tag-based releases (ggml-org#3287) release : v1.7.6 bench : update benches bench : print system info before ctx check stream : add nullptr check of whisper_context (ggml-org#3283) ci : enable main-cuda build (ggml-org#3282) bindings.java : update java example (ggml-org#3281) coreml : backport CoreML features to macos < 14 (ggml-org#3255) ci : reduce musa image size (ggml-org#3277) whisper : add .gitignore entries for OpenVINO support (ggml-org#3276) command: output commands to text file (ggml-org#3273) ci : add apt-get clean to musa Dockerfile (ggml-org#3275) ruby : specify Apple frameworks explicitly on build (ggml-org#3270) talk-llama : sync llama.cpp ...
2 parents ada8c05 + c88ffbf commit f76c650

File tree

141 files changed

+8062
-4982
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

141 files changed

+8062
-4982
lines changed

.devops/main-cuda.Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ ENV CUDA_DOCKER_ARCH=${CUDA_DOCKER_ARCH}
1616

1717
RUN apt-get update && \
1818
apt-get install -y build-essential libsdl2-dev wget cmake git \
19+
&& apt-get clean \
1920
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*
2021

2122
# Ref: https://stackoverflow.com/a/53464012
@@ -26,15 +27,24 @@ COPY .. .
2627
# Enable cuBLAS
2728
RUN make base.en CMAKE_ARGS="-DGGML_CUDA=1"
2829

30+
RUN find /app/build -name "*.o" -delete && \
31+
find /app/build -name "*.a" -delete && \
32+
rm -rf /app/build/CMakeFiles && \
33+
rm -rf /app/build/cmake_install.cmake && \
34+
rm -rf /app/build/_deps
35+
2936
FROM ${BASE_CUDA_RUN_CONTAINER} AS runtime
3037
ENV CUDA_MAIN_VERSION=12.3
3138
ENV LD_LIBRARY_PATH /usr/local/cuda-${CUDA_MAIN_VERSION}/compat:$LD_LIBRARY_PATH
3239
WORKDIR /app
3340

3441
RUN apt-get update && \
3542
apt-get install -y curl ffmpeg wget cmake git \
43+
&& apt-get clean \
3644
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*
3745

3846
COPY --from=build /app /app
47+
RUN du -sh /app/*
48+
RUN find /app -type f -size +100M
3949
ENV PATH=/app/build/bin:$PATH
4050
ENTRYPOINT [ "bash", "-c" ]

.devops/main-musa.Dockerfile

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,31 @@ FROM ${BASE_MUSA_DEV_CONTAINER} AS build
1010
WORKDIR /app
1111

1212
RUN apt-get update && \
13-
apt-get install -y build-essential libsdl2-dev wget cmake git \
14-
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*
13+
apt-get install -y build-essential libsdl2-dev wget cmake git && \
14+
apt-get clean && \
15+
rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/* /tmp/* /var/tmp/*
1516

1617
COPY .. .
1718
# Enable muBLAS
1819
RUN make base.en CMAKE_ARGS="-DGGML_MUSA=1"
1920

21+
RUN find /app/build -name "*.o" -delete && \
22+
find /app/build -name "*.a" -delete && \
23+
rm -rf /app/build/CMakeFiles && \
24+
rm -rf /app/build/cmake_install.cmake && \
25+
rm -rf /app/build/_deps
26+
2027
FROM ${BASE_MUSA_RUN_CONTAINER} AS runtime
2128
WORKDIR /app
2229

2330
RUN apt-get update && \
24-
apt-get install -y curl ffmpeg wget cmake git \
25-
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*
31+
apt-get install -y curl ffmpeg wget cmake git && \
32+
apt-get clean && \
33+
rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/* /tmp/* /var/tmp/*
34+
35+
COPY --from=build /app/build/bin /app/build/bin
36+
COPY --from=build /app/samples /app/samples
37+
COPY --from=build /app/models /app/models
2638

27-
COPY --from=build /app /app
2839
ENV PATH=/app/build/bin:$PATH
2940
ENTRYPOINT [ "bash", "-c" ]

.github/workflows/build.yml

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ on:
44
push:
55
branches:
66
- master
7+
tags:
8+
- 'v*'
79
pull_request:
810
types: [opened, synchronize, reopened]
911
workflow_dispatch:
@@ -41,6 +43,7 @@ jobs:
4143
runs-on: ubuntu-latest
4244
outputs:
4345
tag_name: ${{ steps.tag.outputs.name }}
46+
should_release: ${{ steps.tag.outputs.should_release }}
4447

4548
steps:
4649
- name: Checkout with full history
@@ -55,28 +58,42 @@ jobs:
5558
BUILD_NUMBER=$(git rev-list --count HEAD)
5659
SHORT_HASH=$(git rev-parse --short=7 HEAD)
5760
CUSTOM_TAG="${{ github.event.inputs.pre_release_tag }}"
61+
SHOULD_RELEASE="false"
5862
5963
echo "Raw values:"
6064
echo "BUILD_NUMBER: $BUILD_NUMBER"
6165
echo "SHORT_HASH: $SHORT_HASH"
6266
echo "BRANCH_NAME: ${{ env.BRANCH_NAME }}"
6367
echo "CUSTOM_TAG: $CUSTOM_TAG"
6468
65-
# Use custom tag if provided
66-
if [[ -n "$CUSTOM_TAG" ]]; then
69+
if [[ "${{ github.ref_type }}" == "tag" ]]; then
70+
echo "Using pushed tag name"
71+
TAG_NAME="${{ github.ref_name }}"
72+
SHOULD_RELEASE="true"
73+
elif [[ -n "$CUSTOM_TAG" ]]; then
6774
echo "Using custom tag"
6875
TAG_NAME="${CUSTOM_TAG}"
76+
SHOULD_RELEASE="true"
77+
elif [[ "${{ github.event.inputs.create_release }}" == "true" ]]; then
78+
echo "Manual release requested"
79+
SHOULD_RELEASE="true"
80+
TAG_NAME="b${BUILD_NUMBER}"
6981
elif [[ "${{ env.BRANCH_NAME }}" == "master" ]]; then
7082
echo "Using master branch format"
7183
TAG_NAME="b${BUILD_NUMBER}"
84+
SHOULD_RELEASE="false"
7285
else
7386
echo "Using non-master branch format"
7487
SAFE_NAME=$(echo "${{ env.BRANCH_NAME }}" | tr '/' '-')
7588
TAG_NAME="${SAFE_NAME}-b${BUILD_NUMBER}-${SHORT_HASH}"
89+
SHOULD_RELEASE="false"
7690
fi
7791
7892
echo "Final tag name: $TAG_NAME"
93+
echo "Should release: $SHOULD_RELEASE"
7994
echo "name=$TAG_NAME" >> $GITHUB_OUTPUT
95+
echo "should_release=$SHOULD_RELEASE" >> $GITHUB_OUTPUT
96+
8097
8198
ubuntu-22:
8299
if: ${{ github.event_name == 'push' || github.event_name == 'pull_request' ||
@@ -579,6 +596,7 @@ jobs:
579596
if: ${{ github.event_name == 'push' || github.event_name == 'pull_request' ||
580597
github.event.inputs.run_type == 'full-ci' }}
581598
runs-on: windows-latest
599+
needs: determine-tag
582600

583601
strategy:
584602
matrix:
@@ -662,9 +680,7 @@ jobs:
662680
Compress-Archive -Path "build/bin/${{ matrix.build }}" -DestinationPath "whisper-bin-${{ matrix.arch }}.zip"
663681
664682
- name: Upload binaries
665-
if: matrix.sdl2 == 'ON' && ${{ (github.event_name == 'push' && github.ref == 'refs/heads/master') ||
666-
github.event.inputs.create_release == 'true' ||
667-
github.event.inputs.pre_release_tag != '' }}
683+
if: matrix.sdl2 == 'ON' && ${{ needs.determine-tag.outputs.should_release }}
668684
uses: actions/upload-artifact@v4
669685
with:
670686
name: whisper-bin-${{ matrix.arch }}.zip
@@ -750,9 +766,7 @@ jobs:
750766
Compress-Archive -Path "build/bin/${{ matrix.build }}" -DestinationPath "whisper-blas-bin-${{ matrix.arch }}.zip"
751767
752768
- name: Upload binaries
753-
if: matrix.blas == 'ON' && matrix.sdl2 == 'ON' && ${{ (github.event_name == 'push' && github.ref == 'refs/heads/master') ||
754-
github.event.inputs.create_release == 'true' ||
755-
github.event.inputs.pre_release_tag != '' }}
769+
if: matrix.blas == 'ON' && matrix.sdl2 == 'ON' && ${{ needs.determine-tag.outputs.should_release }}
756770
uses: actions/upload-artifact@v4
757771
with:
758772
name: whisper-blas-bin-${{ matrix.arch }}.zip
@@ -762,6 +776,7 @@ jobs:
762776
if: ${{ github.event_name == 'push' || github.event_name == 'pull_request' ||
763777
github.event.inputs.run_type == 'full-ci' }}
764778
runs-on: windows-2022
779+
needs: determine-tag
765780
strategy:
766781
fail-fast: false
767782
matrix:
@@ -960,9 +975,7 @@ jobs:
960975
Compress-Archive -Path "build/bin/${{ matrix.build }}" -DestinationPath "whisper-cublas-${{ matrix.cuda-toolkit }}-bin-${{ matrix.arch }}.zip"
961976
962977
- name: Upload binaries
963-
if: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/master') ||
964-
github.event.inputs.create_release == 'true' ||
965-
github.event.inputs.pre_release_tag != '' }}
978+
if: ${{ needs.determine-tag.outputs.should_release }}
966979
uses: actions/upload-artifact@v4
967980
with:
968981
name: whisper-cublas-${{ matrix.cuda-toolkit }}-bin-${{ matrix.arch }}.zip
@@ -1039,16 +1052,11 @@ jobs:
10391052

10401053
- name: Pack artifacts
10411054
id: pack_artifacts
1042-
if: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/master') ||
1043-
github.event.inputs.create_release == 'true' ||
1044-
github.event.inputs.pre_release_tag != '' }}
10451055
run: |
10461056
zip --symlinks -r whisper-${{ needs.determine-tag.outputs.tag_name }}-xcframework.zip build-apple/whisper.xcframework
10471057
10481058
- name: Upload artifacts
1049-
if: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/master') ||
1050-
github.event.inputs.create_release == 'true' ||
1051-
github.event.inputs.pre_release_tag != '' }}
1059+
if: ${{ needs.determine-tag.outputs.should_release }}
10521060
uses: actions/upload-artifact@v4
10531061
with:
10541062
path: whisper-${{ needs.determine-tag.outputs.tag_name }}-xcframework.zip
@@ -1226,7 +1234,7 @@ jobs:
12261234
./build/bin/quantize models/ggml-tiny.en.bin models/ggml-tiny.en-q4_0.bin q4_0
12271235
12281236
release:
1229-
if: ${{ github.event.inputs.create_release == 'true' || github.event.inputs.pre_release_tag != '' }}
1237+
if: ${{ github.event.inputs.create_release == 'true' || github.event.inputs.pre_release_tag != '' || startsWith(github.ref, 'refs/tags/v') }}
12301238

12311239
runs-on: ubuntu-latest
12321240

@@ -1269,6 +1277,7 @@ jobs:
12691277
with:
12701278
tag_name: ${{ needs.determine-tag.outputs.tag_name }}
12711279
prerelease: ${{ github.event.inputs.pre_release_tag != '' }}
1280+
draft: true
12721281

12731282
- name: Upload release
12741283
id: upload_release
@@ -1295,7 +1304,8 @@ jobs:
12951304
coreml-base-en:
12961305
if: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/master') ||
12971306
github.event.inputs.create_release == 'true' ||
1298-
github.event.inputs.pre_release_tag != '' }}
1307+
github.event.inputs.pre_release_tag != '' ||
1308+
startsWith(github.ref, 'refs/tags/v') }}
12991309
runs-on: macos-latest
13001310
needs: determine-tag
13011311

.github/workflows/docker.yml

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,13 @@ jobs:
1515
env:
1616
COMMIT_SHA: ${{ github.sha }}
1717
strategy:
18+
fail-fast: false
1819
matrix:
1920
config:
2021
- { tag: "main", dockerfile: ".devops/main.Dockerfile", platform: "linux/amd64" }
2122
- { tag: "main-musa", dockerfile: ".devops/main-musa.Dockerfile", platform: "linux/amd64" }
2223
- { tag: "main-intel", dockerfile: ".devops/main-intel.Dockerfile", platform: "linux/amd64" }
23-
#TODO: the cuda image keeps failing - disable for now
24-
# https://github.com/ggerganov/whisper.cpp/actions/runs/11019444428/job/30602020339
25-
#- { tag: "main-cuda", dockerfile: ".devops/main-cuda.Dockerfile", platform: "linux/amd64" }
24+
- { tag: "main-cuda", dockerfile: ".devops/main-cuda.Dockerfile", platform: "linux/amd64" }
2625

2726
steps:
2827
- name: Check out the repo
@@ -43,21 +42,35 @@ jobs:
4342
username: ${{ github.repository_owner }}
4443
password: ${{ secrets.GITHUB_TOKEN }}
4544

46-
- name: Build and push Docker image (versioned)
47-
if: github.event_name == 'push'
48-
uses: docker/build-push-action@v5
49-
with:
50-
context: .
51-
push: true
52-
platforms: ${{ matrix.config.platform }}
53-
tags: "ghcr.io/${{ github.repository }}:${{ matrix.config.tag }}-${{ env.COMMIT_SHA }}"
54-
file: ${{ matrix.config.dockerfile }}
45+
- name: Free up disk space
46+
run: |
47+
sudo apt-get remove -y '^dotnet-.*' '^llvm-.*' '^mysql-.*' '^postgresql-.*'
48+
sudo apt-get autoremove -y
49+
sudo apt-get autoclean
50+
51+
sudo rm -rf /usr/share/dotnet
52+
sudo rm -rf /usr/local/lib/android
53+
sudo rm -rf /opt/ghc
54+
sudo rm -rf /opt/hostedtoolcache/CodeQL
55+
56+
docker system prune -af
57+
58+
df -h
59+
60+
- name: Generate tags
61+
id: tags
62+
run: |
63+
TAGS="ghcr.io/${{ github.repository }}:${{ matrix.config.tag }}"
64+
if [ "${{ github.event_name }}" == "push" ]; then
65+
TAGS="$TAGS,ghcr.io/${{ github.repository }}:${{ matrix.config.tag }}-${{ env.COMMIT_SHA }}"
66+
fi
67+
echo "tags=$TAGS" >> $GITHUB_OUTPUT
5568
5669
- name: Build and push Docker image (tagged)
57-
uses: docker/build-push-action@v4
70+
uses: docker/build-push-action@v5
5871
with:
5972
context: .
6073
push: ${{ github.event_name == 'push' }}
6174
platforms: ${{ matrix.config.platform }}
62-
tags: "ghcr.io/${{ github.repository }}:${{ matrix.config.tag }}"
75+
tags: ${{ steps.tags.outputs.tags }}
6376
file: ${{ matrix.config.dockerfile }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ extra/bench-gg.txt
5050
models/*.mlmodel
5151
models/*.mlmodelc
5252
models/*.mlpackage
53+
models/*-encoder-openvino.xml
54+
models/*-encoder-openvino-cache/
5355
bindings/java/.gradle/
5456
bindings/java/.idea/
5557
.idea/

CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cmake_minimum_required(VERSION 3.5) # for add_link_options and implicit target directories.
22
project("whisper.cpp" C CXX)
3-
project("whisper.cpp" VERSION 1.7.5)
3+
project("whisper.cpp" VERSION 1.7.6)
44
include(CheckIncludeFileCXX)
55

66
set(SOVERSION 1)
@@ -182,6 +182,10 @@ get_directory_property(WHISPER_TRANSIENT_DEFINES COMPILE_DEFINITIONS)
182182
set_target_properties(whisper PROPERTIES PUBLIC_HEADER ${CMAKE_CURRENT_SOURCE_DIR}/include/whisper.h)
183183
install(TARGETS whisper LIBRARY PUBLIC_HEADER)
184184

185+
target_compile_definitions(whisper PRIVATE
186+
WHISPER_VERSION="${PROJECT_VERSION}"
187+
)
188+
185189
configure_package_config_file(
186190
${CMAKE_CURRENT_SOURCE_DIR}/cmake/whisper-config.cmake.in
187191
${CMAKE_CURRENT_BINARY_DIR}/whisper-config.cmake

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
[![Conan Center](https://shields.io/conan/v/whisper-cpp)](https://conan.io/center/whisper-cpp)
88
[![npm](https://img.shields.io/npm/v/whisper.cpp.svg)](https://www.npmjs.com/package/whisper.cpp/)
99

10-
Stable: [v1.7.5](https://github.com/ggml-org/whisper.cpp/releases/tag/v1.7.5) / [Roadmap](https://github.com/orgs/ggml-org/projects/4/)
10+
Stable: [v1.7.6](https://github.com/ggml-org/whisper.cpp/releases/tag/v1.7.6) / [Roadmap](https://github.com/orgs/ggml-org/projects/4/)
1111

1212
High-performance inference of [OpenAI's Whisper](https://github.com/openai/whisper) automatic speech recognition (ASR) model:
1313

@@ -80,7 +80,7 @@ Now build the [whisper-cli](examples/cli) example and transcribe an audio file l
8080
```bash
8181
# build the project
8282
cmake -B build
83-
cmake --build build --config Release
83+
cmake --build build -j --config Release
8484

8585
# transcribe an audio file
8686
./build/bin/whisper-cli -f samples/jfk.wav
@@ -149,7 +149,7 @@ standard cmake setup with:
149149
```bash
150150
# build with GGML_BLAS defined
151151
cmake -B build -DGGML_BLAS=1
152-
cmake --build build --config Release
152+
cmake --build build -j --config Release
153153
./build/bin/whisper-cli [ .. etc .. ]
154154
```
155155

@@ -163,7 +163,7 @@ Here are the steps for creating and using a quantized model:
163163
```bash
164164
# quantize a model with Q5_0 method
165165
cmake -B build
166-
cmake --build build --config Release
166+
cmake --build build -j --config Release
167167
./build/bin/quantize models/ggml-base.en.bin models/ggml-base.en-q5_0.bin q5_0
168168

169169
# run the examples as usual, specifying the quantized model file
@@ -489,7 +489,7 @@ You will need to have [sdl2](https://wiki.libsdl.org/SDL2/Installation) installe
489489

490490
```bash
491491
cmake -B build -DWHISPER_SDL2=ON
492-
cmake --build build --config Release
492+
cmake --build build -j --config Release
493493
./build/bin/whisper-stream -m ./models/ggml-base.en.bin -t 8 --step 500 --length 5000
494494
```
495495

@@ -709,7 +709,9 @@ For more details, see the conversion script [models/convert-pt-to-ggml.py](model
709709
## XCFramework
710710
The XCFramework is a precompiled version of the library for iOS, visionOS, tvOS,
711711
and macOS. It can be used in Swift projects without the need to compile the
712-
library from source. For examples:
712+
library from source. For example, the v1.7.5 version of the XCFramework can be
713+
used as follows:
714+
713715
```swift
714716
// swift-tools-version: 5.10
715717
// The swift-tools-version declares the minimum version of Swift required to build this package.

0 commit comments

Comments
 (0)