├── models
├── .gitignore
├── requirements-openvino.txt
├── requirements-coreml.txt
├── for-tests-ggml-base.bin
├── for-tests-ggml-tiny.bin
├── for-tests-ggml-base.en.bin
├── for-tests-ggml-large.bin
├── for-tests-ggml-medium.bin
├── for-tests-ggml-small.bin
├── for-tests-ggml-tiny.en.bin
├── for-tests-ggml-medium.en.bin
├── for-tests-ggml-small.en.bin
├── generate-coreml-model.sh
├── generate-coreml-interface.sh
└── download-ggml-model.cmd
├── samples
├── .gitignore
├── jfk.wav
└── README.md
├── spm-headers
├── ggml.h
└── whisper.h
├── bindings
├── go
│ ├── .gitignore
│ ├── samples
│ │ └── jfk.wav
│ ├── pkg
│ │ └── whisper
│ │ │ ├── doc.go
│ │ │ ├── consts.go
│ │ │ └── context_test.go
│ ├── doc.go
│ ├── go.mod
│ ├── examples
│ │ ├── go-whisper
│ │ │ ├── color.go
│ │ │ └── main.go
│ │ └── go-model-download
│ │ │ └── context.go
│ └── LICENSE
├── javascript
│ ├── .gitignore
│ ├── package.json
│ ├── package-tmpl.json
│ └── CMakeLists.txt
├── java
│ ├── settings.gradle
│ ├── gradle
│ │ └── wrapper
│ │ │ ├── gradle-wrapper.jar
│ │ │ └── gradle-wrapper.properties
│ ├── src
│ │ ├── main
│ │ │ └── java
│ │ │ │ └── io
│ │ │ │ └── github
│ │ │ │ └── ggerganov
│ │ │ │ └── whispercpp
│ │ │ │ ├── ggml
│ │ │ │ ├── GgmlTensor.java
│ │ │ │ └── GgmlType.java
│ │ │ │ ├── model
│ │ │ │ ├── WhisperState.java
│ │ │ │ ├── EModel.java
│ │ │ │ ├── WhisperTokenData.java
│ │ │ │ ├── WhisperModel.java
│ │ │ │ └── WhisperModelLoader.java
│ │ │ │ ├── params
│ │ │ │ ├── WhisperFilters.java
│ │ │ │ ├── WhisperSamplingStrategy.java
│ │ │ │ ├── WhisperHParams.java
│ │ │ │ ├── GreedyParams.java
│ │ │ │ ├── BeamSearchParams.java
│ │ │ │ ├── CBool.java
│ │ │ │ └── WhisperContextParams.java
│ │ │ │ ├── callbacks
│ │ │ │ ├── WhisperProgressCallback.java
│ │ │ │ ├── WhisperEncoderBeginCallback.java
│ │ │ │ ├── WhisperNewSegmentCallback.java
│ │ │ │ └── WhisperLogitsFilterCallback.java
│ │ │ │ ├── bean
│ │ │ │ └── WhisperSegment.java
│ │ │ │ └── WhisperContext.java
│ │ └── test
│ │ │ └── java
│ │ │ └── io
│ │ │ └── github
│ │ │ └── ggerganov
│ │ │ └── whispercpp
│ │ │ └── WhisperJnaLibraryTest.java
│ └── gradle.properties
├── ruby
│ └── ext
│ │ ├── .gitignore
│ │ ├── ruby_whisper.h
│ │ └── extconf.rb
└── CMakeLists.txt
├── examples
├── whisper.android
│ ├── app
│ │ ├── .gitignore
│ │ ├── src
│ │ │ ├── main
│ │ │ │ ├── res
│ │ │ │ │ ├── values
│ │ │ │ │ │ ├── strings.xml
│ │ │ │ │ │ └── themes.xml
│ │ │ │ │ ├── mipmap-anydpi
│ │ │ │ │ │ └── ic_launcher.xml
│ │ │ │ │ ├── xml
│ │ │ │ │ │ ├── backup_rules.xml
│ │ │ │ │ │ └── data_extraction_rules.xml
│ │ │ │ │ └── drawable
│ │ │ │ │ │ └── ic_launcher_foreground.xml
│ │ │ │ ├── java
│ │ │ │ │ └── com
│ │ │ │ │ │ └── whispercppdemo
│ │ │ │ │ │ ├── ui
│ │ │ │ │ │ └── theme
│ │ │ │ │ │ │ ├── Color.kt
│ │ │ │ │ │ │ └── Type.kt
│ │ │ │ │ │ └── MainActivity.kt
│ │ │ │ └── AndroidManifest.xml
│ │ │ ├── test
│ │ │ │ └── java
│ │ │ │ │ └── com
│ │ │ │ │ └── whispercppdemo
│ │ │ │ │ └── ExampleUnitTest.kt
│ │ │ └── androidTest
│ │ │ │ └── java
│ │ │ │ └── com
│ │ │ │ └── whispercppdemo
│ │ │ │ └── ExampleInstrumentedTest.kt
│ │ └── proguard-rules.pro
│ ├── lib
│ │ ├── .gitignore
│ │ └── src
│ │ │ └── main
│ │ │ └── AndroidManifest.xml
│ ├── .idea
│ │ ├── .name
│ │ ├── .gitignore
│ │ ├── compiler.xml
│ │ ├── vcs.xml
│ │ ├── misc.xml
│ │ └── gradle.xml
│ ├── gradle
│ │ └── wrapper
│ │ │ ├── gradle-wrapper.jar
│ │ │ └── gradle-wrapper.properties
│ ├── .gitignore
│ ├── build.gradle
│ ├── settings.gradle
│ └── gradle.properties
├── whisper.android.java
│ ├── app
│ │ ├── .gitignore
│ │ ├── src
│ │ │ ├── main
│ │ │ │ ├── res
│ │ │ │ │ ├── values
│ │ │ │ │ │ ├── strings.xml
│ │ │ │ │ │ ├── colors.xml
│ │ │ │ │ │ └── themes.xml
│ │ │ │ │ ├── mipmap-hdpi
│ │ │ │ │ │ ├── ic_launcher.png
│ │ │ │ │ │ └── ic_launcher_round.png
│ │ │ │ │ ├── mipmap-mdpi
│ │ │ │ │ │ ├── ic_launcher.png
│ │ │ │ │ │ └── ic_launcher_round.png
│ │ │ │ │ ├── mipmap-xhdpi
│ │ │ │ │ │ ├── ic_launcher.png
│ │ │ │ │ │ └── ic_launcher_round.png
│ │ │ │ │ ├── mipmap-xxhdpi
│ │ │ │ │ │ ├── ic_launcher.png
│ │ │ │ │ │ └── ic_launcher_round.png
│ │ │ │ │ ├── mipmap-xxxhdpi
│ │ │ │ │ │ ├── ic_launcher.png
│ │ │ │ │ │ └── ic_launcher_round.png
│ │ │ │ │ ├── mipmap-anydpi-v26
│ │ │ │ │ │ ├── ic_launcher.xml
│ │ │ │ │ │ └── ic_launcher_round.xml
│ │ │ │ │ ├── values-night
│ │ │ │ │ │ └── themes.xml
│ │ │ │ │ └── drawable-v24
│ │ │ │ │ │ └── ic_launcher_foreground.xml
│ │ │ │ ├── java
│ │ │ │ │ └── com
│ │ │ │ │ │ ├── litongjava
│ │ │ │ │ │ └── whisper
│ │ │ │ │ │ │ └── android
│ │ │ │ │ │ │ └── java
│ │ │ │ │ │ │ ├── app
│ │ │ │ │ │ │ └── App.java
│ │ │ │ │ │ │ ├── bean
│ │ │ │ │ │ │ └── WhisperSegment.java
│ │ │ │ │ │ │ └── task
│ │ │ │ │ │ │ ├── LoadModelTask.java
│ │ │ │ │ │ │ └── TranscriptionTask.java
│ │ │ │ │ │ └── whispercpp
│ │ │ │ │ │ └── java
│ │ │ │ │ │ └── whisper
│ │ │ │ │ │ ├── WhisperCpuConfig.java
│ │ │ │ │ │ └── WhisperUtils.java
│ │ │ │ ├── AndroidManifest.xml
│ │ │ │ └── jni
│ │ │ │ │ └── whisper
│ │ │ │ │ └── CMakeLists.txt
│ │ │ ├── test
│ │ │ │ └── java
│ │ │ │ │ └── com
│ │ │ │ │ └── litongjava
│ │ │ │ │ └── whisper
│ │ │ │ │ └── android
│ │ │ │ │ └── java
│ │ │ │ │ └── ExampleUnitTest.java
│ │ │ └── androidTest
│ │ │ │ └── java
│ │ │ │ └── com
│ │ │ │ └── litongjava
│ │ │ │ └── whisper
│ │ │ │ └── android
│ │ │ │ └── java
│ │ │ │ └── ExampleInstrumentedTest.java
│ │ ├── proguard-rules.pro
│ │ └── build.gradle
│ ├── settings.gradle
│ ├── README_files
│ │ └── 1.jpg
│ ├── gradle
│ │ └── wrapper
│ │ │ ├── gradle-wrapper.jar
│ │ │ └── gradle-wrapper.properties
│ ├── .gitignore
│ ├── build.gradle
│ ├── gradle.properties
│ └── README.md
├── talk
│ ├── .gitignore
│ ├── speak.bat
│ ├── CMakeLists.txt
│ ├── speak.ps1
│ ├── gpt-2.h
│ ├── README.md
│ └── speak
├── talk-llama
│ ├── .gitignore
│ ├── speak.bat
│ ├── speak.ps1
│ ├── CMakeLists.txt
│ ├── unicode-data.h
│ ├── unicode.h
│ ├── prompts
│ │ └── talk-alpaca.txt
│ └── speak
├── addon.node
│ ├── .gitignore
│ ├── package.json
│ ├── __test__
│ │ └── whisper.spec.js
│ ├── index.js
│ ├── README.md
│ └── CMakeLists.txt
├── whisper.swiftui
│ ├── .gitignore
│ ├── whisper.swiftui.demo
│ │ ├── Resources
│ │ │ ├── models
│ │ │ │ └── .gitignore
│ │ │ └── samples
│ │ │ │ └── .gitignore
│ │ ├── Supporting files
│ │ │ ├── Assets.xcassets
│ │ │ │ ├── Contents.json
│ │ │ │ ├── AccentColor.colorset
│ │ │ │ │ └── Contents.json
│ │ │ │ └── AppIcon.appiconset
│ │ │ │ │ └── Contents.json
│ │ │ ├── Preview Content
│ │ │ │ └── Preview Assets.xcassets
│ │ │ │ │ └── Contents.json
│ │ │ └── WhisperCppDemo.entitlements
│ │ ├── WhisperCppDemoApp.swift
│ │ ├── Utils
│ │ │ ├── RiffWaveUtils.swift
│ │ │ └── Recorder.swift
│ │ └── UI
│ │ │ └── ContentView.swift
│ ├── whisper.swiftui.xcodeproj
│ │ ├── .gitignore
│ │ └── project.xcworkspace
│ │ │ ├── .gitignore
│ │ │ └── xcshareddata
│ │ │ └── IDEWorkspaceChecks.plist
│ └── README.md
├── quantize
│ ├── README.md
│ └── CMakeLists.txt
├── command
│ ├── commands.txt
│ └── CMakeLists.txt
├── whisper.objc
│ ├── whisper.objc
│ │ ├── Assets.xcassets
│ │ │ ├── Contents.json
│ │ │ ├── AccentColor.colorset
│ │ │ │ └── Contents.json
│ │ │ └── AppIcon.appiconset
│ │ │ │ └── Contents.json
│ │ ├── AppDelegate.h
│ │ ├── SceneDelegate.h
│ │ ├── main.m
│ │ ├── Info.plist
│ │ ├── ViewController.h
│ │ ├── AppDelegate.m
│ │ └── Base.lproj
│ │ │ └── LaunchScreen.storyboard
│ └── whisper.objc.xcodeproj
│ │ └── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
├── bench
│ └── CMakeLists.txt
├── main
│ └── CMakeLists.txt
├── wchess
│ ├── wchess.wasm
│ │ ├── chessboardjs-1.0.0
│ │ │ ├── img
│ │ │ │ └── chesspieces
│ │ │ │ │ └── wikipedia
│ │ │ │ │ ├── bB.png
│ │ │ │ │ ├── bK.png
│ │ │ │ │ ├── bN.png
│ │ │ │ │ ├── bP.png
│ │ │ │ │ ├── bQ.png
│ │ │ │ │ ├── bR.png
│ │ │ │ │ ├── wB.png
│ │ │ │ │ ├── wK.png
│ │ │ │ │ ├── wN.png
│ │ │ │ │ ├── wP.png
│ │ │ │ │ ├── wQ.png
│ │ │ │ │ └── wR.png
│ │ │ ├── css
│ │ │ │ ├── chessboard-1.0.0.min.css
│ │ │ │ └── chessboard-1.0.0.css
│ │ │ └── js
│ │ │ │ └── chessboard-1.0.0
│ │ │ │ ├── package.json
│ │ │ │ ├── LICENSE.md
│ │ │ │ └── CHANGELOG.md
│ │ └── CMakeLists.txt
│ ├── wchess.cmd
│ │ └── CMakeLists.txt
│ ├── CMakeLists.txt
│ ├── libwchess
│ │ ├── CMakeLists.txt
│ │ ├── Chessboard.h
│ │ └── WChess.h
│ └── README.md
├── python
│ └── test_whisper_processor.py
├── sycl
│ ├── ls-sycl-device.cpp
│ ├── CMakeLists.txt
│ ├── run-whisper.sh
│ ├── build.sh
│ └── README.md
├── lsp
│ └── CMakeLists.txt
├── stream
│ └── CMakeLists.txt
├── server
│ └── CMakeLists.txt
├── common-ggml.h
├── stream.wasm
│ ├── README.md
│ └── CMakeLists.txt
├── bench.wasm
│ ├── README.md
│ └── CMakeLists.txt
├── talk.wasm
│ ├── gpt-2.h
│ └── CMakeLists.txt
├── command.wasm
│ ├── README.md
│ └── CMakeLists.txt
├── grammar-parser.h
├── common-sdl.h
├── whisper.wasm
│ ├── CMakeLists.txt
│ └── README.md
└── generate-karaoke.sh
├── tests
├── .gitignore
├── en-2-ref.txt
├── es-0-ref.txt
└── test-whisper.js
├── scripts
├── sync-ggml.last
├── sha-all.sh
├── convert-all.sh
├── gen-authors.sh
├── sync-llama.sh
├── quantize-all.sh
└── deploy-wasm.sh
├── README_sycl.md
├── .gitmodules
├── ggml-cuda
├── argsort.cuh
├── sumrows.cuh
├── acc.cuh
├── pad.cuh
├── alibi.cuh
├── rope.cuh
├── arange.cuh
├── clamp.cuh
├── concat.cuh
├── im2col.cuh
├── pool2d.cuh
├── scale.cuh
├── getrows.cuh
├── softmax.cuh
├── upscale.cuh
├── diagmask.cuh
├── tsembd.cuh
├── quantize.cuh
├── cpy.cuh
├── norm.cuh
├── binbcast.cuh
├── mmvq.cuh
├── convert.cuh
├── mmq.cuh
├── dmmv.cuh
├── unary.cuh
├── scale.cu
├── clamp.cu
├── arange.cu
├── sumrows.cu
├── quantize.cu
└── diagmask.cu
├── grammars
├── colors.gbnf
└── chess.gbnf
├── .devops
├── main.Dockerfile
├── cublas.Dockerfile
└── main-cuda.Dockerfile
├── .github
└── workflows
│ ├── bindings-go.yml
│ ├── bindings-ruby.yml
│ ├── examples.yml
│ └── docker.yml
├── cmake
├── DefaultTargetOptions.cmake
└── GitVars.cmake
├── coreml
└── whisper-encoder.h
├── openvino
└── whisper-openvino-encoder.h
├── ggml-vulkan.h
├── .gitignore
├── LICENSE
├── ggml-kompute.h
├── ggml-opencl.h
└── ggml-cuda.h
/models/.gitignore:
--------------------------------------------------------------------------------
1 | *.bin
2 |
--------------------------------------------------------------------------------
/samples/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 |
--------------------------------------------------------------------------------
/spm-headers/ggml.h:
--------------------------------------------------------------------------------
1 | ../ggml.h
--------------------------------------------------------------------------------
/spm-headers/whisper.h:
--------------------------------------------------------------------------------
1 | ../whisper.h
--------------------------------------------------------------------------------
/bindings/go/.gitignore:
--------------------------------------------------------------------------------
1 | build
2 | models
3 |
--------------------------------------------------------------------------------
/bindings/javascript/.gitignore:
--------------------------------------------------------------------------------
1 | publish.log
2 |
--------------------------------------------------------------------------------
/examples/whisper.android/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/examples/whisper.android/lib/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/examples/whisper.android.java/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/examples/whisper.android/.idea/.name:
--------------------------------------------------------------------------------
1 | WhisperCppDemo
--------------------------------------------------------------------------------
/tests/.gitignore:
--------------------------------------------------------------------------------
1 | *.wav
2 | *.ogg
3 | *.wav.txt
4 |
--------------------------------------------------------------------------------
/examples/talk/.gitignore:
--------------------------------------------------------------------------------
1 | audio.mp3
2 | to_speak.txt
3 |
--------------------------------------------------------------------------------
/examples/talk-llama/.gitignore:
--------------------------------------------------------------------------------
1 | audio.mp3
2 | to_speak.txt
3 |
--------------------------------------------------------------------------------
/bindings/java/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = "whispercpp"
2 |
--------------------------------------------------------------------------------
/examples/addon.node/.gitignore:
--------------------------------------------------------------------------------
1 | .idea
2 | node_modules
3 | build
4 |
--------------------------------------------------------------------------------
/examples/whisper.swiftui/.gitignore:
--------------------------------------------------------------------------------
1 | xcuserdata
2 | xcshareddata
3 |
--------------------------------------------------------------------------------
/scripts/sync-ggml.last:
--------------------------------------------------------------------------------
1 | 4151b0420d7a8f4c3c1b420afa0f62ca441b9cd8
2 |
--------------------------------------------------------------------------------
/examples/whisper.swiftui/whisper.swiftui.demo/Resources/models/.gitignore:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/examples/whisper.swiftui/whisper.swiftui.demo/Resources/samples/.gitignore:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/examples/whisper.swiftui/whisper.swiftui.xcodeproj/.gitignore:
--------------------------------------------------------------------------------
1 | xcuserdata/
2 |
--------------------------------------------------------------------------------
/models/requirements-openvino.txt:
--------------------------------------------------------------------------------
1 | openvino-dev[pytorch,onnx]
2 | openai-whisper
--------------------------------------------------------------------------------
/README_sycl.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/royshil/whisper.cpp/master/README_sycl.md
--------------------------------------------------------------------------------
/samples/jfk.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/royshil/whisper.cpp/master/samples/jfk.wav
--------------------------------------------------------------------------------
/examples/talk/speak.bat:
--------------------------------------------------------------------------------
1 | @powershell -ExecutionPolicy Bypass -F examples\talk\speak.ps1 %1 %2
2 |
--------------------------------------------------------------------------------
/models/requirements-coreml.txt:
--------------------------------------------------------------------------------
1 | torch
2 | coremltools
3 | openai-whisper
4 | ane_transformers
5 |
--------------------------------------------------------------------------------
/examples/whisper.android/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 |
--------------------------------------------------------------------------------
/examples/whisper.android.java/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 | rootProject.name = "whisper.android.java"
--------------------------------------------------------------------------------
/bindings/go/samples/jfk.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/royshil/whisper.cpp/master/bindings/go/samples/jfk.wav
--------------------------------------------------------------------------------
/examples/talk-llama/speak.bat:
--------------------------------------------------------------------------------
1 | @powershell -ExecutionPolicy Bypass -F examples\talk-llama\speak.ps1 %1 %2
2 |
--------------------------------------------------------------------------------
/examples/whisper.swiftui/whisper.swiftui.xcodeproj/project.xcworkspace/.gitignore:
--------------------------------------------------------------------------------
1 | contents.xcworkspacedata
2 |
--------------------------------------------------------------------------------
/examples/quantize/README.md:
--------------------------------------------------------------------------------
1 | # quantize
2 |
3 | Tool for integer quantization of Whisper `ggml` model files
4 |
--------------------------------------------------------------------------------
/models/for-tests-ggml-base.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/royshil/whisper.cpp/master/models/for-tests-ggml-base.bin
--------------------------------------------------------------------------------
/models/for-tests-ggml-tiny.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/royshil/whisper.cpp/master/models/for-tests-ggml-tiny.bin
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "bindings/ios"]
2 | path = bindings/ios
3 | url = https://github.com/ggerganov/whisper.spm
4 |
--------------------------------------------------------------------------------
/models/for-tests-ggml-base.en.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/royshil/whisper.cpp/master/models/for-tests-ggml-base.en.bin
--------------------------------------------------------------------------------
/models/for-tests-ggml-large.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/royshil/whisper.cpp/master/models/for-tests-ggml-large.bin
--------------------------------------------------------------------------------
/models/for-tests-ggml-medium.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/royshil/whisper.cpp/master/models/for-tests-ggml-medium.bin
--------------------------------------------------------------------------------
/models/for-tests-ggml-small.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/royshil/whisper.cpp/master/models/for-tests-ggml-small.bin
--------------------------------------------------------------------------------
/models/for-tests-ggml-tiny.en.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/royshil/whisper.cpp/master/models/for-tests-ggml-tiny.en.bin
--------------------------------------------------------------------------------
/models/for-tests-ggml-medium.en.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/royshil/whisper.cpp/master/models/for-tests-ggml-medium.en.bin
--------------------------------------------------------------------------------
/models/for-tests-ggml-small.en.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/royshil/whisper.cpp/master/models/for-tests-ggml-small.en.bin
--------------------------------------------------------------------------------
/bindings/go/pkg/whisper/doc.go:
--------------------------------------------------------------------------------
1 | /*
2 | This is the higher-level speech-to-text whisper.cpp API for go
3 | */
4 | package whisper
5 |
--------------------------------------------------------------------------------
/examples/command/commands.txt:
--------------------------------------------------------------------------------
1 | enable
2 | disable
3 | cat
4 | dog
5 | apple
6 | red
7 | blue
8 | green
9 | lightblue
10 |
--------------------------------------------------------------------------------
/ggml-cuda/argsort.cuh:
--------------------------------------------------------------------------------
1 | #include "common.cuh"
2 |
3 | void ggml_cuda_op_argsort(ggml_backend_cuda_context & ctx, ggml_tensor * dst);
4 |
--------------------------------------------------------------------------------
/ggml-cuda/sumrows.cuh:
--------------------------------------------------------------------------------
1 | #include "common.cuh"
2 |
3 | void ggml_cuda_op_sum_rows(ggml_backend_cuda_context & ctx, ggml_tensor * dst);
4 |
--------------------------------------------------------------------------------
/examples/whisper.android/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | WhisperCppDemo
3 |
--------------------------------------------------------------------------------
/bindings/java/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/royshil/whisper.cpp/master/bindings/java/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/examples/whisper.android.java/README_files/1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/royshil/whisper.cpp/master/examples/whisper.android.java/README_files/1.jpg
--------------------------------------------------------------------------------
/examples/whisper.android.java/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | whisper.android.java
3 |
--------------------------------------------------------------------------------
/examples/whisper.objc/whisper.objc/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "author" : "xcode",
4 | "version" : 1
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/ggml-cuda/acc.cuh:
--------------------------------------------------------------------------------
1 | #include "common.cuh"
2 |
3 | #define CUDA_ACC_BLOCK_SIZE 256
4 |
5 | void ggml_cuda_op_acc(ggml_backend_cuda_context & ctx, ggml_tensor * dst);
6 |
--------------------------------------------------------------------------------
/ggml-cuda/pad.cuh:
--------------------------------------------------------------------------------
1 | #include "common.cuh"
2 |
3 | #define CUDA_PAD_BLOCK_SIZE 256
4 |
5 | void ggml_cuda_op_pad(ggml_backend_cuda_context & ctx, ggml_tensor * dst);
6 |
--------------------------------------------------------------------------------
/bindings/java/src/main/java/io/github/ggerganov/whispercpp/ggml/GgmlTensor.java:
--------------------------------------------------------------------------------
1 | package io.github.ggerganov.whispercpp.ggml;
2 |
3 | public class GgmlTensor {
4 | }
5 |
--------------------------------------------------------------------------------
/bindings/ruby/ext/.gitignore:
--------------------------------------------------------------------------------
1 | Makefile
2 | ggml.c
3 | ggml.h
4 | ggml-alloc.c
5 | ggml-alloc.h
6 | whisper.bundle
7 | whisper.cpp
8 | whisper.h
9 | dr_wav.h
10 |
--------------------------------------------------------------------------------
/examples/whisper.android/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/royshil/whisper.cpp/master/examples/whisper.android/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/ggml-cuda/alibi.cuh:
--------------------------------------------------------------------------------
1 | #include "common.cuh"
2 |
3 | #define CUDA_ALIBI_BLOCK_SIZE 32
4 |
5 | void ggml_cuda_op_alibi(ggml_backend_cuda_context & ctx, ggml_tensor * dst);
6 |
--------------------------------------------------------------------------------
/ggml-cuda/rope.cuh:
--------------------------------------------------------------------------------
1 | #include "common.cuh"
2 |
3 | #define CUDA_ROPE_BLOCK_SIZE 256
4 |
5 | void ggml_cuda_op_rope(ggml_backend_cuda_context & ctx, ggml_tensor * dst);
6 |
--------------------------------------------------------------------------------
/ggml-cuda/arange.cuh:
--------------------------------------------------------------------------------
1 | #include "common.cuh"
2 |
3 | #define CUDA_ARANGE_BLOCK_SIZE 256
4 |
5 | void ggml_cuda_op_arange(ggml_backend_cuda_context & ctx, ggml_tensor * dst);
6 |
--------------------------------------------------------------------------------
/ggml-cuda/clamp.cuh:
--------------------------------------------------------------------------------
1 | #include "common.cuh"
2 |
3 | #define CUDA_CLAMP_BLOCK_SIZE 256
4 |
5 | void ggml_cuda_op_clamp(ggml_backend_cuda_context & ctx, ggml_tensor * dst);
6 |
--------------------------------------------------------------------------------
/ggml-cuda/concat.cuh:
--------------------------------------------------------------------------------
1 | #include "common.cuh"
2 |
3 | #define CUDA_CONCAT_BLOCK_SIZE 256
4 |
5 | void ggml_cuda_op_concat(ggml_backend_cuda_context & ctx, ggml_tensor * dst);
6 |
--------------------------------------------------------------------------------
/ggml-cuda/im2col.cuh:
--------------------------------------------------------------------------------
1 | #include "common.cuh"
2 |
3 | #define CUDA_IM2COL_BLOCK_SIZE 256
4 |
5 | void ggml_cuda_op_im2col(ggml_backend_cuda_context & ctx, ggml_tensor * dst);
6 |
--------------------------------------------------------------------------------
/ggml-cuda/pool2d.cuh:
--------------------------------------------------------------------------------
1 | #include "common.cuh"
2 |
3 | #define CUDA_POOL2D_BLOCK_SIZE 256
4 |
5 | void ggml_cuda_op_pool2d(ggml_backend_cuda_context & ctx, ggml_tensor * dst);
6 |
--------------------------------------------------------------------------------
/ggml-cuda/scale.cuh:
--------------------------------------------------------------------------------
1 | #include "common.cuh"
2 |
3 | #define CUDA_SCALE_BLOCK_SIZE 256
4 |
5 | void ggml_cuda_op_scale(ggml_backend_cuda_context & ctx, ggml_tensor * dst);
6 |
--------------------------------------------------------------------------------
/bindings/go/doc.go:
--------------------------------------------------------------------------------
1 | /*
2 | github.com/ggerganov/whisper.cpp/bindings/go
3 | provides a speech-to-text service bindings for the Go programming language.
4 | */
5 | package whisper
6 |
--------------------------------------------------------------------------------
/bindings/java/src/main/java/io/github/ggerganov/whispercpp/model/WhisperState.java:
--------------------------------------------------------------------------------
1 | package io.github.ggerganov.whispercpp.model;
2 |
3 | public class WhisperState {
4 | }
5 |
--------------------------------------------------------------------------------
/examples/whisper.android.java/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/royshil/whisper.cpp/master/examples/whisper.android.java/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/examples/whisper.swiftui/whisper.swiftui.demo/Supporting files/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "author" : "xcode",
4 | "version" : 1
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/ggml-cuda/getrows.cuh:
--------------------------------------------------------------------------------
1 | #include "common.cuh"
2 |
3 | #define CUDA_GET_ROWS_BLOCK_SIZE 256
4 |
5 | void ggml_cuda_op_get_rows(ggml_backend_cuda_context & ctx, ggml_tensor * dst);
6 |
--------------------------------------------------------------------------------
/ggml-cuda/softmax.cuh:
--------------------------------------------------------------------------------
1 | #include "common.cuh"
2 |
3 | #define CUDA_SOFT_MAX_BLOCK_SIZE 1024
4 |
5 | void ggml_cuda_op_soft_max(ggml_backend_cuda_context & ctx, ggml_tensor * dst);
6 |
--------------------------------------------------------------------------------
/ggml-cuda/upscale.cuh:
--------------------------------------------------------------------------------
1 | #include "common.cuh"
2 |
3 | #define CUDA_UPSCALE_BLOCK_SIZE 256
4 |
5 | void ggml_cuda_op_upscale(ggml_backend_cuda_context & ctx, ggml_tensor * dst);
6 |
--------------------------------------------------------------------------------
/scripts/sha-all.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # Compute the SHA1 of all model files in ./models/ggml-*.bin
4 |
5 | for f in ./models/ggml-*.bin; do
6 | shasum "$f" -a 1
7 | done
8 |
--------------------------------------------------------------------------------
/examples/whisper.android/lib/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/ggml-cuda/diagmask.cuh:
--------------------------------------------------------------------------------
1 | #include "common.cuh"
2 |
3 | #define CUDA_DIAG_MASK_INF_BLOCK_SIZE 32
4 |
5 | void ggml_cuda_op_diag_mask_inf(ggml_backend_cuda_context & ctx, ggml_tensor * dst);
6 |
--------------------------------------------------------------------------------
/examples/whisper.swiftui/whisper.swiftui.demo/Supporting files/Preview Content/Preview Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "author" : "xcode",
4 | "version" : 1
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/ggml-cuda/tsembd.cuh:
--------------------------------------------------------------------------------
1 | #include "common.cuh"
2 |
3 | #define CUDA_TIMESTEP_EMBEDDING_BLOCK_SIZE 256
4 |
5 | void ggml_cuda_op_timestep_embedding(ggml_backend_cuda_context & ctx, ggml_tensor * dst);
6 |
--------------------------------------------------------------------------------
/examples/whisper.android.java/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/royshil/whisper.cpp/master/examples/whisper.android.java/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/examples/whisper.android.java/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/royshil/whisper.cpp/master/examples/whisper.android.java/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/examples/whisper.android.java/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/royshil/whisper.cpp/master/examples/whisper.android.java/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/examples/whisper.android.java/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/royshil/whisper.cpp/master/examples/whisper.android.java/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/examples/whisper.android.java/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/royshil/whisper.cpp/master/examples/whisper.android.java/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/examples/bench/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(TARGET bench)
2 | add_executable(${TARGET} bench.cpp)
3 |
4 | include(DefaultTargetOptions)
5 |
6 | target_link_libraries(${TARGET} PRIVATE whisper ${CMAKE_THREAD_LIBS_INIT})
7 |
--------------------------------------------------------------------------------
/examples/main/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(TARGET main)
2 | add_executable(${TARGET} main.cpp)
3 |
4 | include(DefaultTargetOptions)
5 |
6 | target_link_libraries(${TARGET} PRIVATE common whisper ${CMAKE_THREAD_LIBS_INIT})
7 |
--------------------------------------------------------------------------------
/examples/wchess/wchess.wasm/chessboardjs-1.0.0/img/chesspieces/wikipedia/bB.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/royshil/whisper.cpp/master/examples/wchess/wchess.wasm/chessboardjs-1.0.0/img/chesspieces/wikipedia/bB.png
--------------------------------------------------------------------------------
/examples/wchess/wchess.wasm/chessboardjs-1.0.0/img/chesspieces/wikipedia/bK.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/royshil/whisper.cpp/master/examples/wchess/wchess.wasm/chessboardjs-1.0.0/img/chesspieces/wikipedia/bK.png
--------------------------------------------------------------------------------
/examples/wchess/wchess.wasm/chessboardjs-1.0.0/img/chesspieces/wikipedia/bN.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/royshil/whisper.cpp/master/examples/wchess/wchess.wasm/chessboardjs-1.0.0/img/chesspieces/wikipedia/bN.png
--------------------------------------------------------------------------------
/examples/wchess/wchess.wasm/chessboardjs-1.0.0/img/chesspieces/wikipedia/bP.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/royshil/whisper.cpp/master/examples/wchess/wchess.wasm/chessboardjs-1.0.0/img/chesspieces/wikipedia/bP.png
--------------------------------------------------------------------------------
/examples/wchess/wchess.wasm/chessboardjs-1.0.0/img/chesspieces/wikipedia/bQ.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/royshil/whisper.cpp/master/examples/wchess/wchess.wasm/chessboardjs-1.0.0/img/chesspieces/wikipedia/bQ.png
--------------------------------------------------------------------------------
/examples/wchess/wchess.wasm/chessboardjs-1.0.0/img/chesspieces/wikipedia/bR.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/royshil/whisper.cpp/master/examples/wchess/wchess.wasm/chessboardjs-1.0.0/img/chesspieces/wikipedia/bR.png
--------------------------------------------------------------------------------
/examples/wchess/wchess.wasm/chessboardjs-1.0.0/img/chesspieces/wikipedia/wB.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/royshil/whisper.cpp/master/examples/wchess/wchess.wasm/chessboardjs-1.0.0/img/chesspieces/wikipedia/wB.png
--------------------------------------------------------------------------------
/examples/wchess/wchess.wasm/chessboardjs-1.0.0/img/chesspieces/wikipedia/wK.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/royshil/whisper.cpp/master/examples/wchess/wchess.wasm/chessboardjs-1.0.0/img/chesspieces/wikipedia/wK.png
--------------------------------------------------------------------------------
/examples/wchess/wchess.wasm/chessboardjs-1.0.0/img/chesspieces/wikipedia/wN.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/royshil/whisper.cpp/master/examples/wchess/wchess.wasm/chessboardjs-1.0.0/img/chesspieces/wikipedia/wN.png
--------------------------------------------------------------------------------
/examples/wchess/wchess.wasm/chessboardjs-1.0.0/img/chesspieces/wikipedia/wP.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/royshil/whisper.cpp/master/examples/wchess/wchess.wasm/chessboardjs-1.0.0/img/chesspieces/wikipedia/wP.png
--------------------------------------------------------------------------------
/examples/wchess/wchess.wasm/chessboardjs-1.0.0/img/chesspieces/wikipedia/wQ.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/royshil/whisper.cpp/master/examples/wchess/wchess.wasm/chessboardjs-1.0.0/img/chesspieces/wikipedia/wQ.png
--------------------------------------------------------------------------------
/examples/wchess/wchess.wasm/chessboardjs-1.0.0/img/chesspieces/wikipedia/wR.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/royshil/whisper.cpp/master/examples/wchess/wchess.wasm/chessboardjs-1.0.0/img/chesspieces/wikipedia/wR.png
--------------------------------------------------------------------------------
/examples/whisper.android.java/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/royshil/whisper.cpp/master/examples/whisper.android.java/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/examples/whisper.android.java/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/royshil/whisper.cpp/master/examples/whisper.android.java/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/examples/whisper.android.java/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/royshil/whisper.cpp/master/examples/whisper.android.java/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/examples/whisper.android.java/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/royshil/whisper.cpp/master/examples/whisper.android.java/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/examples/whisper.android.java/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/royshil/whisper.cpp/master/examples/whisper.android.java/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/examples/quantize/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(TARGET quantize)
2 | add_executable(${TARGET} quantize.cpp)
3 |
4 | include(DefaultTargetOptions)
5 |
6 | target_link_libraries(${TARGET} PRIVATE common whisper ${CMAKE_THREAD_LIBS_INIT})
7 |
--------------------------------------------------------------------------------
/examples/whisper.android/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/examples/whisper.android/app/src/main/res/values/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/ggml-cuda/quantize.cuh:
--------------------------------------------------------------------------------
1 | #include "common.cuh"
2 |
3 | #define CUDA_QUANTIZE_BLOCK_SIZE 256
4 |
5 | void quantize_row_q8_1_cuda(const float * x, void * vy, const int64_t kx, const int64_t ky, const int64_t kx_padded, cudaStream_t stream);
6 |
--------------------------------------------------------------------------------
/examples/whisper.android/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/examples/whisper.objc/whisper.objc.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/examples/python/test_whisper_processor.py:
--------------------------------------------------------------------------------
1 | import whisper_processor
2 |
3 | try:
4 | result = whisper_processor.process_audio("./audio/wake_word_detected16k.wav", "base.en")
5 | print(result)
6 | except Exception as e:
7 | print(f"Error: {e}")
--------------------------------------------------------------------------------
/examples/whisper.objc/whisper.objc/Assets.xcassets/AccentColor.colorset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "colors" : [
3 | {
4 | "idiom" : "universal"
5 | }
6 | ],
7 | "info" : {
8 | "author" : "xcode",
9 | "version" : 1
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/examples/whisper.swiftui/whisper.swiftui.demo/WhisperCppDemoApp.swift:
--------------------------------------------------------------------------------
1 | import SwiftUI
2 |
3 | @main
4 | struct WhisperCppDemoApp: App {
5 | var body: some Scene {
6 | WindowGroup {
7 | ContentView()
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/ggml-cuda/cpy.cuh:
--------------------------------------------------------------------------------
1 | #include "common.cuh"
2 |
3 | #define CUDA_CPY_BLOCK_SIZE 32
4 |
5 | void ggml_cuda_cpy(ggml_backend_cuda_context & ctx, const ggml_tensor * src0, ggml_tensor * src1);
6 |
7 | void ggml_cuda_dup(ggml_backend_cuda_context & ctx, ggml_tensor * dst);
8 |
--------------------------------------------------------------------------------
/examples/whisper.swiftui/whisper.swiftui.demo/Supporting files/Assets.xcassets/AccentColor.colorset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "colors" : [
3 | {
4 | "idiom" : "universal"
5 | }
6 | ],
7 | "info" : {
8 | "author" : "xcode",
9 | "version" : 1
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/examples/wchess/wchess.cmd/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | if (WHISPER_SDL2)
2 | set(TARGET wchess)
3 | add_executable(${TARGET} wchess.cmd.cpp)
4 |
5 | include(DefaultTargetOptions)
6 |
7 | target_link_libraries(${TARGET} PRIVATE wchess-core common-sdl ${CMAKE_THREAD_LIBS_INIT})
8 | endif ()
9 |
--------------------------------------------------------------------------------
/bindings/java/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-bin.zip
4 | networkTimeout=10000
5 | zipStoreBase=GRADLE_USER_HOME
6 | zipStorePath=wrapper/dists
7 |
--------------------------------------------------------------------------------
/bindings/java/src/main/java/io/github/ggerganov/whispercpp/params/WhisperFilters.java:
--------------------------------------------------------------------------------
1 | package io.github.ggerganov.whispercpp.params;
2 |
3 | import java.util.List;
4 |
5 | public class WhisperFilters {
6 | int n_mel;
7 | int n_fft;
8 |
9 | List data;
10 | }
11 |
--------------------------------------------------------------------------------
/examples/sycl/ls-sycl-device.cpp:
--------------------------------------------------------------------------------
1 | /*MIT license
2 | Copyright (C) 2024 Intel Corporation
3 | SPDX-License-Identifier: MIT
4 | */
5 |
6 | #include "ggml-sycl.h"
7 |
8 | int main(int argc, char ** argv) {
9 | ggml_backend_sycl_print_sycl_devices();
10 | return 0;
11 | }
--------------------------------------------------------------------------------
/examples/talk/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | if (WHISPER_SDL2)
2 | # talk
3 | set(TARGET talk)
4 | add_executable(${TARGET} talk.cpp gpt-2.cpp)
5 | target_link_libraries(${TARGET} PRIVATE common common-sdl whisper ${CMAKE_THREAD_LIBS_INIT})
6 |
7 | include(DefaultTargetOptions)
8 | endif ()
9 |
--------------------------------------------------------------------------------
/examples/whisper.objc/whisper.objc/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // whisper.objc
4 | //
5 | // Created by Georgi Gerganov on 23.10.22.
6 | //
7 |
8 | #import
9 |
10 | @interface AppDelegate : UIResponder
11 |
12 |
13 | @end
14 |
15 |
--------------------------------------------------------------------------------
/bindings/java/src/main/java/io/github/ggerganov/whispercpp/model/EModel.java:
--------------------------------------------------------------------------------
1 | package io.github.ggerganov.whispercpp.model;
2 |
3 | public enum EModel {
4 | MODEL_UNKNOWN,
5 | MODEL_TINY,
6 | MODEL_BASE,
7 | MODEL_SMALL,
8 | MODEL_MEDIUM,
9 | MODEL_LARGE,
10 | }
11 |
--------------------------------------------------------------------------------
/examples/lsp/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | if (WHISPER_SDL2)
2 | # stream
3 | set(TARGET lsp)
4 | add_executable(${TARGET} lsp.cpp)
5 |
6 | include(DefaultTargetOptions)
7 |
8 | target_link_libraries(${TARGET} PRIVATE common json_cpp common-sdl whisper ${CMAKE_THREAD_LIBS_INIT})
9 | endif ()
10 |
--------------------------------------------------------------------------------
/examples/stream/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | if (WHISPER_SDL2)
2 | # stream
3 | set(TARGET stream)
4 | add_executable(${TARGET} stream.cpp)
5 |
6 | include(DefaultTargetOptions)
7 |
8 | target_link_libraries(${TARGET} PRIVATE common common-sdl whisper ${CMAKE_THREAD_LIBS_INIT})
9 | endif ()
10 |
--------------------------------------------------------------------------------
/ggml-cuda/norm.cuh:
--------------------------------------------------------------------------------
1 | #include "common.cuh"
2 |
3 | void ggml_cuda_op_norm(ggml_backend_cuda_context & ctx, ggml_tensor * dst);
4 |
5 | void ggml_cuda_op_group_norm(ggml_backend_cuda_context & ctx, ggml_tensor * dst);
6 |
7 | void ggml_cuda_op_rms_norm(ggml_backend_cuda_context & ctx, ggml_tensor * dst);
8 |
--------------------------------------------------------------------------------
/examples/command/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | if (WHISPER_SDL2)
2 | # command
3 | set(TARGET command)
4 | add_executable(${TARGET} command.cpp)
5 |
6 | include(DefaultTargetOptions)
7 |
8 | target_link_libraries(${TARGET} PRIVATE common common-sdl whisper ${CMAKE_THREAD_LIBS_INIT})
9 | endif ()
10 |
--------------------------------------------------------------------------------
/examples/whisper.android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Wed Dec 14 10:37:24 EST 2022
2 | distributionBase=GRADLE_USER_HOME
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
4 | distributionPath=wrapper/dists
5 | zipStorePath=wrapper/dists
6 | zipStoreBase=GRADLE_USER_HOME
7 |
--------------------------------------------------------------------------------
/examples/whisper.android.java/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Fri Oct 20 11:07:15 HST 2023
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip
7 |
--------------------------------------------------------------------------------
/examples/whisper.objc/whisper.objc/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "platform" : "ios",
6 | "size" : "1024x1024"
7 | }
8 | ],
9 | "info" : {
10 | "author" : "xcode",
11 | "version" : 1
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/examples/whisper.android/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/caches
5 | /.idea/libraries
6 | /.idea/modules.xml
7 | /.idea/workspace.xml
8 | /.idea/navEditor.xml
9 | /.idea/assetWizardSettings.xml
10 | .DS_Store
11 | /build
12 | /captures
13 | .externalNativeBuild
14 | .cxx
15 | local.properties
16 |
--------------------------------------------------------------------------------
/examples/server/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(TARGET server)
2 | add_executable(${TARGET} server.cpp httplib.h)
3 |
4 | include(DefaultTargetOptions)
5 |
6 | target_link_libraries(${TARGET} PRIVATE common json_cpp whisper ${CMAKE_THREAD_LIBS_INIT})
7 |
8 | if (WIN32)
9 | target_link_libraries(${TARGET} PRIVATE ws2_32)
10 | endif()
11 |
--------------------------------------------------------------------------------
/examples/whisper.android.java/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/caches
5 | /.idea/libraries
6 | /.idea/modules.xml
7 | /.idea/workspace.xml
8 | /.idea/navEditor.xml
9 | /.idea/assetWizardSettings.xml
10 | .DS_Store
11 | /build
12 | /captures
13 | .externalNativeBuild
14 | .cxx
15 | local.properties
16 |
--------------------------------------------------------------------------------
/bindings/java/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xms256m -Xmx1024m
2 | system.include.dir=/usr/include
3 | #system.local.include.dir=../../include
4 | system.local.include.dir=./build/generated/sources/headers/java/main
5 | jni.include.dir=/usr/lib/jvm/java-8-openjdk-amd64/include/
6 | jni.lib.dir=/usr/lib/jvm/java-8-openjdk-amd64/lib/
7 |
--------------------------------------------------------------------------------
/bindings/ruby/ext/ruby_whisper.h:
--------------------------------------------------------------------------------
1 | #ifndef __RUBY_WHISPER_H
2 | #define __RUBY_WHISPER_H
3 |
4 | #include "whisper.h"
5 |
6 | typedef struct {
7 | struct whisper_context *context;
8 | } ruby_whisper;
9 |
10 | typedef struct {
11 | struct whisper_full_params params;
12 | bool diarize;
13 | } ruby_whisper_params;
14 |
15 | #endif
16 |
--------------------------------------------------------------------------------
/examples/whisper.android/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 | plugins {
3 | id 'com.android.application' version '8.1.1' apply false
4 | id 'com.android.library' version '8.1.1' apply false
5 | id 'org.jetbrains.kotlin.android' version '1.9.0' apply false
6 | }
--------------------------------------------------------------------------------
/examples/whisper.android/app/src/main/res/mipmap-anydpi/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/examples/whisper.objc/whisper.objc/SceneDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // SceneDelegate.h
3 | // whisper.objc
4 | //
5 | // Created by Georgi Gerganov on 23.10.22.
6 | //
7 |
8 | #import
9 |
10 | @interface SceneDelegate : UIResponder
11 |
12 | @property (strong, nonatomic) UIWindow * window;
13 |
14 | @end
15 |
16 |
--------------------------------------------------------------------------------
/examples/whisper.android.java/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/scripts/convert-all.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | models=( "tiny.en" "tiny" "base.en" "base" "small.en" "small" "medium.en" "medium" "large-v1" "large-v2" "large-v3" )
4 |
5 | for model in "${models[@]}"; do
6 | python3 models/convert-pt-to-ggml.py ~/.cache/whisper/$model.pt ../whisper models/
7 | mv -v models/ggml-model.bin models/ggml-$model.bin
8 | done
9 |
--------------------------------------------------------------------------------
/examples/whisper.android.java/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/examples/whisper.objc/whisper.objc.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ggml-cuda/binbcast.cuh:
--------------------------------------------------------------------------------
1 | #include "common.cuh"
2 |
3 | void ggml_cuda_op_repeat(ggml_backend_cuda_context & ctx, ggml_tensor * dst);
4 | void ggml_cuda_op_add(ggml_backend_cuda_context & ctx, ggml_tensor * dst);
5 | void ggml_cuda_op_mul(ggml_backend_cuda_context & ctx, ggml_tensor * dst);
6 | void ggml_cuda_op_div(ggml_backend_cuda_context & ctx, ggml_tensor * dst);
7 |
--------------------------------------------------------------------------------
/examples/whisper.swiftui/whisper.swiftui.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/examples/wchess/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_subdirectory(libwchess)
2 | set_target_properties(wchess-core PROPERTIES FOLDER "libs")
3 |
4 | if (EMSCRIPTEN)
5 | add_subdirectory(wchess.wasm)
6 | set_target_properties(wchess.wasm PROPERTIES FOLDER "libs")
7 | else()
8 | add_subdirectory(wchess.cmd)
9 | set_target_properties(wchess PROPERTIES FOLDER "libs")
10 | endif()
11 |
--------------------------------------------------------------------------------
/examples/sycl/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | # MIT license
2 | # Copyright (C) 2024 Intel Corporation
3 | # SPDX-License-Identifier: MIT
4 |
5 | set(TARGET ls-sycl-device)
6 | add_executable(${TARGET} ls-sycl-device.cpp)
7 | install(TARGETS ${TARGET} RUNTIME)
8 | target_link_libraries(${TARGET} PRIVATE common llama ${CMAKE_THREAD_LIBS_INIT})
9 | target_compile_features(${TARGET} PRIVATE cxx_std_17)
--------------------------------------------------------------------------------
/examples/addon.node/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "whisper-addon",
3 | "version": "0.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "author": "Qanhe Chen",
7 | "license": "MIT",
8 | "scripts": {
9 | "test": "jest"
10 | },
11 | "devDependencies": {
12 | "cmake-js": "^7.1.1",
13 | "jest": "^29.4.0",
14 | "node-addon-api": "^5.0.0"
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/samples/README.md:
--------------------------------------------------------------------------------
1 | # Audio samples
2 |
3 | This folder contains various audio files used for testing.
4 | If you want to quickly get some more samples, simply run `make samples`. This will download several public audio files and convert them to appropriate 16-bit WAV format using `ffmpeg`
5 |
6 | https://github.com/ggerganov/whisper.cpp/blob/a09ce6e8899198015729ffc49ae10f67370906b1/Makefile#L104-L123
7 |
--------------------------------------------------------------------------------
/scripts/gen-authors.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | printf "# date: $(date)\n" > AUTHORS
4 | printf "# this file is auto-generated by scripts/gen-authors.sh\n\n" >> AUTHORS
5 |
6 | git log --format='%an <%ae>' --reverse --date=short master | awk '!seen[$0]++' | sort >> AUTHORS
7 |
8 | # if necessary, update your name here. for example: jdoe -> John Doe
9 | sed -i '' 's/^jdoe/John Doe/g' AUTHORS
10 |
--------------------------------------------------------------------------------
/examples/whisper.android.java/app/src/main/java/com/litongjava/whisper/android/java/app/App.java:
--------------------------------------------------------------------------------
1 | package com.litongjava.whisper.android.java.app;
2 |
3 | import android.app.Application;
4 |
5 | import com.blankj.utilcode.util.Utils;
6 |
7 | public class App extends Application {
8 | @Override
9 | public void onCreate() {
10 | super.onCreate();
11 | Utils.init(this);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/examples/whisper.android/app/src/main/java/com/whispercppdemo/ui/theme/Color.kt:
--------------------------------------------------------------------------------
1 | package com.whispercppdemo.ui.theme
2 |
3 | import androidx.compose.ui.graphics.Color
4 |
5 | val Purple80 = Color(0xFFD0BCFF)
6 | val PurpleGrey80 = Color(0xFFCCC2DC)
7 | val Pink80 = Color(0xFFEFB8C8)
8 |
9 | val Purple40 = Color(0xFF6650a4)
10 | val PurpleGrey40 = Color(0xFF625b71)
11 | val Pink40 = Color(0xFF7D5260)
--------------------------------------------------------------------------------
/bindings/java/src/main/java/io/github/ggerganov/whispercpp/params/WhisperSamplingStrategy.java:
--------------------------------------------------------------------------------
1 | package io.github.ggerganov.whispercpp.params;
2 |
3 | /** Available sampling strategies */
4 | public enum WhisperSamplingStrategy {
5 | /** similar to OpenAI's GreedyDecoder */
6 | WHISPER_SAMPLING_GREEDY,
7 |
8 | /** similar to OpenAI's BeamSearchDecoder */
9 | WHISPER_SAMPLING_BEAM_SEARCH
10 | }
11 |
--------------------------------------------------------------------------------
/grammars/colors.gbnf:
--------------------------------------------------------------------------------
1 | # - red
2 | # - green
3 | # - blue
4 | #
5 | # example:
6 | #
7 | # ./command -m ./models/ggml-tiny.en.bin -t 8 --grammar ./grammars/colors.gbnf --prompt "red, green, blue," --context "green, red, blue,"
8 | #
9 |
10 | root ::= init color "."
11 | prompt ::= init "."
12 |
13 | # leading space is very important!
14 | init ::= " red, green, blue"
15 |
16 | color ::= ", " ("red" | "green" | "blue")
17 |
--------------------------------------------------------------------------------
/examples/whisper.android.java/app/src/main/java/com/whispercpp/java/whisper/WhisperCpuConfig.java:
--------------------------------------------------------------------------------
1 | package com.whispercpp.java.whisper;
2 |
3 | import android.os.Build;
4 |
5 | import androidx.annotation.RequiresApi;
6 |
7 | public class WhisperCpuConfig {
8 | @RequiresApi(api = Build.VERSION_CODES.N)
9 | public static int getPreferredThreadCount() {
10 | return Math.max(CpuInfo.getHighPerfCpuCount(), 2);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/ggml-cuda/mmvq.cuh:
--------------------------------------------------------------------------------
1 | #include "common.cuh"
2 |
3 | void ggml_cuda_op_mul_mat_vec_q(
4 | ggml_backend_cuda_context & ctx,
5 | const ggml_tensor * src0, const ggml_tensor * src1, ggml_tensor * dst, const char * src0_dd_i, const float * src1_ddf_i,
6 | const char * src1_ddq_i, float * dst_dd_i, const int64_t row_low, const int64_t row_high, const int64_t src1_ncols,
7 | const int64_t src1_padded_row_size, cudaStream_t stream);
8 |
--------------------------------------------------------------------------------
/examples/whisper.android/settings.gradle:
--------------------------------------------------------------------------------
1 | pluginManagement {
2 | repositories {
3 | gradlePluginPortal()
4 | google()
5 | mavenCentral()
6 | }
7 | }
8 | dependencyResolutionManagement {
9 | repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
10 | repositories {
11 | google()
12 | mavenCentral()
13 | }
14 | }
15 | rootProject.name = "WhisperCppDemo"
16 | include ':app'
17 | include ':lib'
18 |
--------------------------------------------------------------------------------
/examples/whisper.android.java/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #FFBB86FC
4 | #FF6200EE
5 | #FF3700B3
6 | #FF03DAC5
7 | #FF018786
8 | #FF000000
9 | #FFFFFFFF
10 |
--------------------------------------------------------------------------------
/ggml-cuda/convert.cuh:
--------------------------------------------------------------------------------
1 | #include "common.cuh"
2 |
3 | #define CUDA_DEQUANTIZE_BLOCK_SIZE 256
4 |
5 | template
6 | using to_t_cuda_t = void (*)(const void * __restrict__ x, T * __restrict__ y, int64_t k, cudaStream_t stream);
7 |
8 | typedef to_t_cuda_t to_fp32_cuda_t;
9 | typedef to_t_cuda_t to_fp16_cuda_t;
10 |
11 | to_fp16_cuda_t ggml_get_to_fp16_cuda(ggml_type type);
12 |
13 | to_fp32_cuda_t ggml_get_to_fp32_cuda(ggml_type type);
14 |
--------------------------------------------------------------------------------
/bindings/go/go.mod:
--------------------------------------------------------------------------------
1 | module github.com/ggerganov/whisper.cpp/bindings/go
2 |
3 | go 1.19
4 |
5 | require (
6 | github.com/go-audio/wav v1.1.0
7 | github.com/stretchr/testify v1.8.1
8 | )
9 |
10 | require (
11 | github.com/davecgh/go-spew v1.1.1 // indirect
12 | github.com/go-audio/audio v1.0.0 // indirect
13 | github.com/go-audio/riff v1.0.0 // indirect
14 | github.com/pmezard/go-difflib v1.0.0 // indirect
15 | gopkg.in/yaml.v3 v3.0.1 // indirect
16 | )
17 |
--------------------------------------------------------------------------------
/examples/wchess/libwchess/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | add_library(wchess-core STATIC
2 | WChess.cpp
3 | WChess.h
4 | Chessboard.cpp
5 | Chessboard.h
6 | )
7 |
8 | target_link_libraries(wchess-core
9 | PUBLIC
10 | whisper
11 | common
12 | )
13 |
14 | target_include_directories(wchess-core
15 | PUBLIC
16 | "$"
17 | )
18 |
19 | # add_executable(test-chessboard test-chessboard.cpp Chessboard.cpp)
20 |
--------------------------------------------------------------------------------
/scripts/sync-llama.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | cp -rpv ../llama.cpp/llama.h ./examples/talk-llama/llama.h
4 | cp -rpv ../llama.cpp/llama.cpp ./examples/talk-llama/llama.cpp
5 | cp -rpv ../llama.cpp/unicode.h ./examples/talk-llama/unicode.h
6 | cp -rpv ../llama.cpp/unicode.cpp ./examples/talk-llama/unicode.cpp
7 | cp -rpv ../llama.cpp/unicode-data.h ./examples/talk-llama/unicode-data.h
8 | cp -rpv ../llama.cpp/unicode-data.cpp ./examples/talk-llama/unicode-data.cpp
9 |
--------------------------------------------------------------------------------
/examples/whisper.android/app/src/test/java/com/whispercppdemo/ExampleUnitTest.kt:
--------------------------------------------------------------------------------
1 | package com.whispercppdemo
2 |
3 | import org.junit.Test
4 |
5 | import org.junit.Assert.*
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * See [testing documentation](http://d.android.com/tools/testing).
11 | */
12 | class ExampleUnitTest {
13 | @Test
14 | fun addition_isCorrect() {
15 | assertEquals(4, 2 + 2)
16 | }
17 | }
--------------------------------------------------------------------------------
/ggml-cuda/mmq.cuh:
--------------------------------------------------------------------------------
1 | #include "common.cuh"
2 |
3 | void ggml_cuda_op_mul_mat_q(
4 | ggml_backend_cuda_context & ctx,
5 | const ggml_tensor * src0, const ggml_tensor * src1, ggml_tensor * dst, const char * src0_dd_i, const float * src1_ddf_i,
6 | const char * src1_ddq_i, float * dst_dd_i, const int64_t row_low, const int64_t row_high, const int64_t src1_ncols,
7 | const int64_t src1_padded_row_size, cudaStream_t stream);
8 |
9 | bool ggml_cuda_supports_mmq(enum ggml_type type);
10 |
--------------------------------------------------------------------------------
/.devops/main.Dockerfile:
--------------------------------------------------------------------------------
1 | FROM ubuntu:22.04 AS build
2 | WORKDIR /app
3 |
4 | RUN apt-get update && \
5 | apt-get install -y build-essential \
6 | && rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*
7 |
8 | COPY .. .
9 | RUN make
10 |
11 | FROM ubuntu:22.04 AS runtime
12 | WORKDIR /app
13 |
14 | RUN apt-get update && \
15 | apt-get install -y curl ffmpeg \
16 | && rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*
17 |
18 | COPY --from=build /app /app
19 | ENTRYPOINT [ "bash", "-c" ]
20 |
--------------------------------------------------------------------------------
/examples/common-ggml.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "ggml.h"
4 |
5 | #include
6 | #include
7 | #include
8 |
9 | enum ggml_ftype ggml_parse_ftype(const char * str);
10 |
11 | void ggml_print_ftypes(FILE * fp = stderr);
12 |
13 | bool ggml_common_quantize_0(
14 | std::ifstream & finp,
15 | std::ofstream & fout,
16 | const ggml_ftype ftype,
17 | const std::vector & to_quant,
18 | const std::vector & to_skip);
19 |
--------------------------------------------------------------------------------
/examples/whisper.swiftui/whisper.swiftui.demo/Supporting files/WhisperCppDemo.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | com.apple.security.app-sandbox
6 |
7 | com.apple.security.device.audio-input
8 |
9 | com.apple.security.files.user-selected.read-only
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/examples/whisper.swiftui/whisper.swiftui.demo/Utils/RiffWaveUtils.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 |
3 | func decodeWaveFile(_ url: URL) throws -> [Float] {
4 | let data = try Data(contentsOf: url)
5 | let floats = stride(from: 44, to: data.count, by: 2).map {
6 | return data[$0..<$0 + 2].withUnsafeBytes {
7 | let short = Int16(littleEndian: $0.load(as: Int16.self))
8 | return max(-1.0, min(Float(short) / 32767.0, 1.0))
9 | }
10 | }
11 | return floats
12 | }
13 |
--------------------------------------------------------------------------------
/examples/whisper.android/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/.github/workflows/bindings-go.yml:
--------------------------------------------------------------------------------
1 | name: Bindings Tests (Go)
2 | on:
3 | push:
4 | paths:
5 | - bindings/go/**
6 | - whisper.h
7 | pull_request:
8 | paths:
9 | - bindings/go/**
10 | - whisper.h
11 |
12 | jobs:
13 | ubuntu-latest:
14 | runs-on: ubuntu-latest
15 | steps:
16 | - uses: actions/setup-go@v3
17 | with:
18 | go-version: '^1.19'
19 | - uses: actions/checkout@v1
20 | - run: |
21 | cd bindings/go
22 | make test
23 |
--------------------------------------------------------------------------------
/examples/sycl/run-whisper.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # MIT license
4 | # Copyright (C) 2024 Intel Corporation
5 | # SPDX-License-Identifier: MIT
6 |
7 | INPUT2="Building a website can be done in 10 simple steps:\nStep 1:"
8 | source /opt/intel/oneapi/setvars.sh
9 |
10 | if [ $# -gt 0 ]; then
11 | export GGML_SYCL_DEVICE=$1
12 | else
13 | export GGML_SYCL_DEVICE=0
14 | fi
15 | echo GGML_SYCL_DEVICE=$GGML_SYCL_DEVICE
16 | #export GGML_SYCL_DEBUG=1
17 | ./build/bin/main -m models/ggml-base.en.bin -f samples/jfk.wav
--------------------------------------------------------------------------------
/cmake/DefaultTargetOptions.cmake:
--------------------------------------------------------------------------------
1 | # Set the default compile features and properties for a target.
2 |
3 | if (NOT TARGET)
4 | message(FATAL_ERROR "TARGET not set before including DefaultTargetOptions")
5 | endif()
6 |
7 | target_compile_features(${TARGET}
8 | PRIVATE
9 | cxx_std_11
10 | )
11 |
12 | set_target_properties(${TARGET}
13 | PROPERTIES
14 | EXPORT_COMPILE_COMMANDS ON
15 | RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
16 | INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib"
17 | )
18 |
--------------------------------------------------------------------------------
/.github/workflows/bindings-ruby.yml:
--------------------------------------------------------------------------------
1 | name: Bindings Tests (Ruby)
2 | on:
3 | push:
4 | paths:
5 | - bindings/ruby/**
6 | - whisper.h
7 | pull_request:
8 | paths:
9 | - bindings/ruby/**
10 | - whisper.h
11 |
12 | jobs:
13 | ubuntu-latest:
14 | runs-on: ubuntu-latest
15 | steps:
16 | - uses: ruby/setup-ruby@v1
17 | with:
18 | ruby-version: '3.0'
19 | - uses: actions/checkout@v1
20 | - run: |
21 | cd bindings/ruby/ext
22 | ruby extconf.rb && make
23 |
--------------------------------------------------------------------------------
/bindings/java/src/main/java/io/github/ggerganov/whispercpp/params/WhisperHParams.java:
--------------------------------------------------------------------------------
1 | package io.github.ggerganov.whispercpp.params;
2 |
3 | public class WhisperHParams {
4 | int n_vocab = 51864;
5 | int n_audio_ctx = 1500;
6 | int n_audio_state = 384;
7 | int n_audio_head = 6;
8 | int n_audio_layer = 4;
9 | int n_text_ctx = 448;
10 | int n_text_state = 384;
11 | int n_text_head = 6;
12 | int n_text_layer = 4;
13 | int n_mels = 80;
14 | int ftype = 1;
15 | }
16 |
--------------------------------------------------------------------------------
/examples/whisper.android.java/app/src/test/java/com/litongjava/whisper/android/java/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.litongjava.whisper.android.java;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/examples/stream.wasm/README.md:
--------------------------------------------------------------------------------
1 | # stream.wasm
2 |
3 | Real-time transcription in the browser using WebAssembly
4 |
5 | Online demo: https://whisper.ggerganov.com/stream/
6 |
7 | ## Build instructions
8 |
9 | ```bash
10 | # build using Emscripten (v3.1.2)
11 | git clone https://github.com/ggerganov/whisper.cpp
12 | cd whisper.cpp
13 | mkdir build-em && cd build-em
14 | emcmake cmake ..
15 | make -j
16 |
17 | # copy the produced page to your HTTP path
18 | cp bin/stream.wasm/* /path/to/html/
19 | cp bin/libstream.worker.js /path/to/html/
20 | ```
21 |
--------------------------------------------------------------------------------
/examples/whisper.objc/whisper.objc/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // whisper.objc
4 | //
5 | // Created by Georgi Gerganov on 23.10.22.
6 | //
7 |
8 | #import
9 | #import "AppDelegate.h"
10 |
11 | int main(int argc, char * argv[]) {
12 | NSString * appDelegateClassName;
13 | @autoreleasepool {
14 | // Setup code that might create autoreleased objects goes here.
15 | appDelegateClassName = NSStringFromClass([AppDelegate class]);
16 | }
17 | return UIApplicationMain(argc, argv, nil, appDelegateClassName);
18 | }
19 |
--------------------------------------------------------------------------------
/examples/whisper.android/app/src/main/res/xml/backup_rules.xml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
13 |
--------------------------------------------------------------------------------
/bindings/java/src/main/java/io/github/ggerganov/whispercpp/ggml/GgmlType.java:
--------------------------------------------------------------------------------
1 | package io.github.ggerganov.whispercpp.ggml;
2 |
3 | public enum GgmlType {
4 | GGML_TYPE_F32,
5 | GGML_TYPE_F16,
6 | GGML_TYPE_Q4_0,
7 | GGML_TYPE_Q4_1,
8 | REMOVED_GGML_TYPE_Q4_2, // support has been removed
9 | REMOVED_GGML_TYPE_Q4_3, // support has been removed
10 | GGML_TYPE_Q5_0,
11 | GGML_TYPE_Q5_1,
12 | GGML_TYPE_Q8_0,
13 | GGML_TYPE_Q8_1,
14 | GGML_TYPE_I8,
15 | GGML_TYPE_I16,
16 | GGML_TYPE_I32,
17 | GGML_TYPE_COUNT,
18 | }
19 |
--------------------------------------------------------------------------------
/examples/talk/speak.ps1:
--------------------------------------------------------------------------------
1 | # Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope CurrentUser
2 | param(
3 | [Parameter(Mandatory=$true)][int]$voicenum,
4 | [Parameter(Mandatory=$true)][string]$textfile
5 | )
6 |
7 | Add-Type -AssemblyName System.Speech;
8 | $speak = New-Object System.Speech.Synthesis.SpeechSynthesizer;
9 | $voiceoptions = $speak.GetInstalledVoices("en-US");
10 | $voice = $voiceoptions[$voicenum % $voiceoptions.count];
11 | $speak.SelectVoice($voice.VoiceInfo.Name);
12 | $speak.Rate="0";
13 | $text = Get-Content -Path $textfile;
14 | $speak.Speak($text);
15 |
--------------------------------------------------------------------------------
/examples/talk-llama/speak.ps1:
--------------------------------------------------------------------------------
1 | # Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope CurrentUser
2 | param(
3 | [Parameter(Mandatory=$true)][int]$voicenum,
4 | [Parameter(Mandatory=$true)][string]$textfile
5 | )
6 |
7 | Add-Type -AssemblyName System.Speech;
8 | $speak = New-Object System.Speech.Synthesis.SpeechSynthesizer;
9 | $voiceoptions = $speak.GetInstalledVoices("en-US");
10 | $voice = $voiceoptions[$voicenum % $voiceoptions.count];
11 | $speak.SelectVoice($voice.VoiceInfo.Name);
12 | $speak.Rate="0";
13 | $text = Get-Content -Path $textfile;
14 | $speak.Speak($text);
15 |
--------------------------------------------------------------------------------
/bindings/java/src/main/java/io/github/ggerganov/whispercpp/params/GreedyParams.java:
--------------------------------------------------------------------------------
1 | package io.github.ggerganov.whispercpp.params;
2 |
3 | import com.sun.jna.Structure;
4 |
5 | import java.util.Collections;
6 | import java.util.List;
7 |
8 | public class GreedyParams extends Structure {
9 | /** ... */
10 | public int best_of;
11 |
12 | @Override
13 | protected List getFieldOrder() {
14 | return Collections.singletonList("best_of");
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/examples/bench.wasm/README.md:
--------------------------------------------------------------------------------
1 | # bench.wasm
2 |
3 | Benchmark the performance of whisper.cpp in the browser using WebAssembly
4 |
5 | Link: https://whisper.ggerganov.com/bench/
6 |
7 | Terminal version: [examples/bench](/examples/bench)
8 |
9 | ## Build instructions
10 |
11 | ```bash
12 | # build using Emscripten (v3.1.2)
13 | git clone https://github.com/ggerganov/whisper.cpp
14 | cd whisper.cpp
15 | mkdir build-em && cd build-em
16 | emcmake cmake ..
17 | make -j
18 |
19 | # copy the produced page to your HTTP path
20 | cp bin/bench.wasm/* /path/to/html/
21 | cp bin/libbench.worker.js /path/to/html/
22 | ```
23 |
--------------------------------------------------------------------------------
/examples/sycl/build.sh:
--------------------------------------------------------------------------------
1 | # MIT license
2 | # Copyright (C) 2024 Intel Corporation
3 | # SPDX-License-Identifier: MIT
4 |
5 | mkdir -p build
6 | cd build
7 | source /opt/intel/oneapi/setvars.sh
8 |
9 | #for FP16
10 | #cmake .. -DWHISPER_SYCL=ON -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx -DWHISPER_SYCL_F16=ON # faster for long-prompt inference
11 |
12 | #for FP32
13 | cmake .. -DWHISPER_SYCL=ON -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx
14 |
15 | #build example/main only
16 | #cmake --build . --config Release --target main
17 |
18 | #build all binary
19 | cmake --build . --config Release -v
--------------------------------------------------------------------------------
/examples/whisper.android.java/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 | buildscript {
3 | repositories {
4 | google()
5 | jcenter()
6 | }
7 | dependencies {
8 | classpath "com.android.tools.build:gradle:4.1.3"
9 |
10 | // NOTE: Do not place your application dependencies here; they belong
11 | // in the individual module build.gradle files
12 | }
13 | }
14 |
15 | allprojects {
16 | repositories {
17 | google()
18 | jcenter()
19 | }
20 | }
21 |
22 | task clean(type: Delete) {
23 | delete rootProject.buildDir
24 | }
--------------------------------------------------------------------------------
/ggml-cuda/dmmv.cuh:
--------------------------------------------------------------------------------
1 | #include "common.cuh"
2 |
3 | // dmmv = dequantize_mul_mat_vec
4 |
5 | // TODO: remove this?
6 | #ifndef GGML_CUDA_DMMV_X
7 | #define GGML_CUDA_DMMV_X 32
8 | #endif
9 |
10 | #ifndef GGML_CUDA_MMV_Y
11 | #define GGML_CUDA_MMV_Y 1
12 | #endif
13 |
14 | void ggml_cuda_op_dequantize_mul_mat_vec(
15 | ggml_backend_cuda_context & ctx,
16 | const ggml_tensor * src0, const ggml_tensor * src1, ggml_tensor * dst, const char * src0_dd_i, const float * src1_ddf_i,
17 | const char * src1_ddq_i, float * dst_dd_i, const int64_t row_low, const int64_t row_high, const int64_t src1_ncols,
18 | const int64_t src1_padded_row_size, cudaStream_t stream);
19 |
--------------------------------------------------------------------------------
/examples/talk/gpt-2.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | // TODO: Change to C-style API and move to ./examples for easy reuse.
4 |
5 | #include "common.h"
6 |
7 | #include
8 | #include