Skip to content

Commit

Permalink
Merge tag 'v1.6.2'
Browse files Browse the repository at this point in the history
* tag 'v1.6.2':
  release : v1.6.2
  Revert "whisper : remove extra backend instance (huh?)" (ggerganov#2182)
  server : fix typo (ggerganov#2181)
  ruby : update bindings (ggerganov#2154)
  release : v1.6.1
  examples : add support for decoding input with ffmpeg (Linux) (ggerganov#2133)
  node : add flash_attn param (ggerganov#2170)
  ci: Update build.yml to suppress warnings about node.js versions (ggerganov#2166)
  release : v1.6.0
  whisper : use flash attention (ggerganov#2152)
  talk-llama : reject runs without required arguments (ggerganov#2153)
  sync : ggml
  metal : support FA without mask + add asserts (llama/7278)
  ggml : add RPC backend (llama/6829)
  rm wait() (llama/7233)
  CUDA: add FP32 FlashAttention vector kernel (llama/7188)
  scripts : sync ggml-rpc
  • Loading branch information
bygreencn committed Aug 9, 2024
2 parents d545d74 + c7b6988 commit d579a05
Show file tree
Hide file tree
Showing 62 changed files with 16,563 additions and 5,216 deletions.
92 changes: 46 additions & 46 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:

steps:
- name: Clone
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3

- name: Build ${{ matrix.arch }}
run: |
Expand All @@ -36,7 +36,7 @@ jobs:

steps:
- name: Clone
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Dependencies
run: |
Expand All @@ -53,10 +53,10 @@ jobs:

steps:
- name: Clone
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Build
uses: cross-platform-actions/action@v0.15.0
uses: cross-platform-actions/action@v0.24.0
with:
operating_system: freebsd
version: '13.2'
Expand All @@ -77,10 +77,10 @@ jobs:

steps:
- name: Clone
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3

- name: Build ${{ matrix.arch }}
run: |
Expand All @@ -105,10 +105,10 @@ jobs:

steps:
- name: Clone
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3

- name: Build ${{ matrix.arch }}
run: |
Expand All @@ -133,10 +133,10 @@ jobs:

steps:
- name: Clone
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3

- name: Build ${{ matrix.arch }}
run: |
Expand Down Expand Up @@ -165,7 +165,7 @@ jobs:

steps:
- name: Clone
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: add oneAPI to apt
shell: bash
Expand All @@ -189,7 +189,7 @@ jobs:
- name: Clone
id: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Build
id: cmake_build
Expand All @@ -215,7 +215,7 @@ jobs:

steps:
- name: Clone
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: add oneAPI to apt
shell: bash
Expand All @@ -239,7 +239,7 @@ jobs:
- name: Clone
id: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Build
id: cmake_build
Expand All @@ -262,7 +262,7 @@ jobs:

steps:
- name: Clone
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup ${{ matrix.sys }}
uses: msys2/setup-msys2@v2
Expand Down Expand Up @@ -328,10 +328,10 @@ jobs:

steps:
- name: Clone
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1
uses: microsoft/setup-msbuild@v2

- name: Fetch SDL2 and set SDL2_DIR
if: matrix.sdl2 == 'ON'
Expand All @@ -356,14 +356,14 @@ jobs:
run: copy "$env:SDL2_DIR/../lib/${{ matrix.s2arc }}/SDL2.dll" build/bin/${{ matrix.build }}

- name: Upload dll
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.jnaPath }}_whisper.dll
path: build/bin/${{ matrix.build }}/whisper.dll

- name: Upload binaries
if: matrix.sdl2 == 'ON'
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v4
with:
name: whisper-bin-${{ matrix.arch }}
path: build/bin/${{ matrix.build }}
Expand Down Expand Up @@ -392,10 +392,10 @@ jobs:

steps:
- name: Clone
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1
uses: microsoft/setup-msbuild@v2

- name: Fetch OpenBLAS
if: matrix.blas == 'ON'
Expand Down Expand Up @@ -453,7 +453,7 @@ jobs:

- name: Upload binaries
if: matrix.blas == 'ON' && matrix.sdl2 == 'ON'
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v4
with:
name: whisper-blas${{ matrix.clblast == 'ON' && '-clblast' || ''}}-bin-${{ matrix.arch }}
path: build/bin/${{ matrix.build }}
Expand All @@ -476,14 +476,14 @@ jobs:

steps:
- name: Clone
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1
uses: microsoft/setup-msbuild@v2

- name: Install CUDA Toolkit
id: cuda-toolkit
uses: Jimver/[email protected].11
uses: Jimver/[email protected].15
with:
cuda: '${{ matrix.cuda-toolkit }}'

Expand Down Expand Up @@ -519,7 +519,7 @@ jobs:

- name: Upload binaries
if: matrix.sdl2 == 'ON'
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v4
with:
name: whisper-cublas-${{ matrix.cuda-toolkit }}-bin-${{ matrix.arch }}
path: build/bin/${{ matrix.build }}
Expand All @@ -533,10 +533,10 @@ jobs:

steps:
- name: Clone
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup emsdk
uses: mymindstorm/setup-emsdk@v12
uses: mymindstorm/setup-emsdk@v14

- name: Verify
run: emcc -v
Expand All @@ -555,7 +555,7 @@ jobs:

steps:
- name: Clone
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Configure
run: |
Expand All @@ -573,24 +573,24 @@ jobs:

steps:
- name: Clone
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: whisper

- name: Clone
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: ggerganov/ggml
path: ggml

- name: Install Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 17
java-version: 21

- name: Setup Android SDK
uses: android-actions/setup-android@v2
uses: android-actions/setup-android@v3

- name: Build
run: |
Expand All @@ -608,20 +608,19 @@ jobs:

steps:
- name: Clone
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: set up JDK 11
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
cache: gradle

- name: Setup Android SDK
uses: android-actions/setup-android@v2
uses: android-actions/setup-android@v3
with:
api-level: 30
build-tools-version: 30.0.3
cmdline-tools-version: 9.0

- name: Build
run: |
Expand All @@ -633,15 +632,16 @@ jobs:
needs: [ 'windows' ]
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install Java
uses: actions/setup-java@v1
uses: actions/setup-java@v4
with:
java-version: 17
distribution: zulu
java-version: 20

- name: Download Windows lib
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: win32-x86-64_whisper.dll
path: bindings/java/build/generated/resources/main/win32-x86-64
Expand All @@ -654,7 +654,7 @@ jobs:
./gradlew build
- name: Upload jar
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: whispercpp.jar
path: bindings/java/build/libs/whispercpp-*.jar
Expand All @@ -676,7 +676,7 @@ jobs:

steps:
- name: Clone
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Test quantize
run: |
Expand Down
26 changes: 25 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cmake_minimum_required (VERSION 3.5)
# Allow for the creation of solution folders.
set_property(GLOBAL PROPERTY USE_FOLDERS ON)

project(whisper.cpp VERSION 1.5.5)
project(whisper.cpp VERSION 1.6.2)
set(SOVERSION 1)

# Add path to modules
Expand Down Expand Up @@ -64,6 +64,10 @@ option(WHISPER_SampleRate "whisper: support for libSampleRate" OFF)
option(WHISPER_sndfile "whisper: support for libsndfile" OFF)


if (CMAKE_SYSTEM_NAME MATCHES "Linux")
option(WHISPER_FFMPEG "whisper: support building and linking with ffmpeg libs (avcodec, swresample, ...)" OFF)
endif()

option(WHISPER_NO_AVX "whisper: disable AVX" OFF)
option(WHISPER_NO_AVX2 "whisper: disable AVX2" OFF)
option(WHISPER_NO_AVX512 "whisper: disable AVX512" ON)
Expand Down Expand Up @@ -130,6 +134,26 @@ else()
set(CMAKE_CXX_STANDARD 11)
endif()

if (WHISPER_FFMPEG)
# As of cmake 3.27, there is no official cmake support for FindFFmpeg.
# Consequnelty we added a FindFFmpeg.cmake script the cmake subfolder:
# whisper.cpp does not need the full ffmpeg libs, just AVFORMAT AVCODEC AVUTIL SWRESAMPLE
# libswresample performs highly optimized audio resampling, rematrixing and sample format conversion operations
# libavcodec provides a generic encoding/decoding framework and contains multiple decoders and encoders for audio, video and subtitle streams, and several bitstream filters.
# libavformat provides a generic framework for multiplexing and demultiplexing (muxing and demuxing) audio, video and subtitle streams.
find_package(FFmpeg REQUIRED)
if (NOT ${FFMPEG_FOUND})
message(FATAL_ERROR "Cannot find ffmpeg libs/headers")
endif()
message(STATUS "Found ffmpeg libs: ${FFMPEG_LIBRARIES}")
message(STATUS "Found ffmpeg headers in: ${FFMPEG_INCLUDE_DIRS}")
message(STATUS "ffmpeg definitions: ${FFMPEG_DEFINITIONS}")
message(STATUS "Found avformat ${AVFORMAT_VERSION}")
include_directories(${FFMPEG_INCLUDE_DIRS})
add_compile_definitions(WHISPER_FFMPEG)
set(WHISPER_EXTRA_LIBS ${WHISPER_EXTRA_LIBS} ${FFMPEG_LIBRARIES})
endif()

# on APPLE
if (APPLE)
# include Accelerate framework
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)
[![npm](https://img.shields.io/npm/v/whisper.cpp.svg)](https://www.npmjs.com/package/whisper.cpp/)

Stable: [v1.5.5](https://github.com/ggerganov/whisper.cpp/releases/tag/v1.5.5) / [Roadmap | F.A.Q.](https://github.com/ggerganov/whisper.cpp/discussions/126)
Stable: [v1.6.2](https://github.com/ggerganov/whisper.cpp/releases/tag/v1.6.0) / [Roadmap | F.A.Q.](https://github.com/ggerganov/whisper.cpp/discussions/126)

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

Expand Down
2 changes: 1 addition & 1 deletion bindings/javascript/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "whisper.cpp",
"version": "1.5.5",
"version": "1.6.2",
"description": "Whisper speech recognition",
"main": "whisper.js",
"scripts": {
Expand Down
12 changes: 12 additions & 0 deletions bindings/ruby/Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
require 'rake/clean'
require 'rubygems/package'

desc 'Build gem'
task :package do
spec_source = File.read File.join(File.dirname(__FILE__),'whispercpp.gemspec')
spec = nil
# see: http://gist.github.com/16215
Thread.new { spec = eval("#{spec_source}") }.join
spec.validate
Gem::Package.build(spec)
end
Loading

0 comments on commit d579a05

Please sign in to comment.