* cmake : update semver handling to be consistent with ggml/llama.cpp
This commit modifies the semantic version handling to be consistent with
how llama.cpp and ggml handle semver.
This commit introdues a new example named test-cmake which is intended
to be used to test the cmake configuration and installation.
* ci : update release workflow to be consistent with llama.cpp
work in progress...
* ci : fix if statement in release.yml
* ci : comment out all but one build in release.yml
This is just for testing and this commit should not be included in the
main PR later.
* ci : use DEPLOY_KEY_RELEASE
This commit updates the release and make-release workflows to use the
DEPLOY_KEY_RELEASE secret. Two github ruleset have been imported.
* ci : add github rulesets for releases
These were retrived from llama.cpp and then imported into my fork for
testing. If all works well they will be imported into whisper.cpp
upstream as well.
* fix move artifacts step
* examples : use FetchContent for llama.cpp in talk-llama
This commit updated the example talk-llama to remove the vendored
llama.cpp and instead use FetchContent to pull it in from the
upstream repo.
* ci: add GGML_NATIVE=OFF to build-clang.yml
This commit disables native CPU instructions from the ubuntu-22-clang
job.
The motivation for this is that currently it is possible that the
running compiling llama.cpp (via ccache) might have support for cpu
instructions that are not available on the target runner.
Refs: https://github.com/ggml-org/whisper.cpp/actions/runs/32224048267/job/95980031403?pr=3996
* ci : add missing GGML_NATIVE=OFF to jobs
* ci : add attestation for signed release artifacts
This commit add attenstions of artifacts to the release workflow.
After building the artifacts can be verified with the following command:
```console
$ curl -sSL -o whisper-bin-ubuntu-x64.tar.gz \
https://github.com/danbev/whisper.cpp/releases/download/b4947/whisper-bin-ubuntu-x64.tar.gz
$ gh attestation verify --repo danbev/whisper.cpp whisper-bin-ubuntu-x64.tar.gz
Loaded digest sha256:722a6812263195d7ee2192b57fc64a6d6b09a6cdf2f55a152f793db27a651e31 for file://whisper-bin-ubuntu-x64.tar.gz
Loaded 1 attestation from GitHub API
The following policy criteria will be enforced:
- Predicate type must match:................ https://slsa.dev/provenance/v1
- Source Repository Owner URI must match:... https://github.com/danbev
- Source Repository URI must match:......... https://github.com/danbev/whisper.cpp
- Subject Alternative Name must match regex: (?i)^https://github\.com/danbev/whisper\.cpp/
- OIDC Issuer must match:................... https://token.actions.githubusercontent.com
✓ Verification succeeded!
The following 1 attestation matched the policy criteria
- Attestation #1
- Build repo:..... danbev/whisper.cpp
- Build workflow:. .github/workflows/release.yml@refs/heads/master
- Signer repo:.... danbev/whisper.cpp
- Signer workflow: .github/workflows/release.yml@refs/heads/master
```
* cmake : add WHISPER_USE_SYSTEM_LLAMA option [no ci]
This commit adds a new CMake option WHISPER_USE_SYSTEM_LLAMA that allows
the talk-llama example to use a system-installed llama.cpp library.
Setting this will automatically also set WHISPER_USE_SYSTEM_GGML to ON
and the system ggml library will be used in addition to the system
llama.cpp.
* ci : remove unused ccache step
* Revert "ci : comment out all but one build in release.yml"
This reverts commit 24b56776e1.
* ci : set WHISPER_BUILD_IS_DEV=OFF in release.yml
Fix --vad-min-silence-duration-ms (-vsd) parsing in whisper-vad-speech-segments.
The option was incorrectly assigned to vad_min_speech_duration_ms instead of vad_min_silence_duration_ms. As a result, the requested silence duration was ignored and the minimum speech duration was overwritten.
* Fix#587: Remove leading space from txt output
The BPE tokenizer used by Whisper produces tokens with leading spaces,
causing each line in the txt output to start with an unwanted space.
This fix strips leading whitespace (spaces and tabs) from each segment
when writing to txt output files, improving the readability of the
transcription output.
Fixes: https://github.com/ggml-org/whisper.cpp/issues/587
* ci, examples : add package-lock.json to examples addon node
This commit commits the package-lock.json file for examples/addon.node.
This is needed to make the CI workflow work properly and after we
started pinning the action versions in the workflow, the CI started
failing because the package-lock.json was not committed. At least that
is what I think is happening.
* ci: use node 20.x and 22.x instead of 16.x and 18.x
* fix CMakeLists.txt target properties for addon.node
* fix/android-debug-inference-issue: Applied BUILD_TYPE=Release to NDK build of whisper.android example
* fix/android-debug-inference-issue: Applied BUILD_TYPE=Release to NDK build of whisper.android.java example
Fixed the -vspd flag for vad_min_speech_duration_ms, to prevent hiding vad_min_silence_duration_ms.
In usage () clarified the output timestamp units.
Fixed a few typos.
Adds a `--version` option to whisper-cli that prints the library version
via `whisper_version()` and exits, plus a corresponding entry in the help
output. Mirrors the existing `-h`/`--help` handling.
Closes#608
* cli : merge tokens split across UTF-8 boundaries in JSON output
When a multi-byte UTF-8 codepoint (most commonly a CJK character, 3 bytes)
is split across multiple whisper tokens, the -ojf/--output-json-full
writer emitted each token's partial bytes as its own JSON string, producing
invalid UTF-8 that chokes downstream parsers.
Merge adjacent tokens in output_json whenever the accumulated text still
ends on an incomplete UTF-8 sequence. The merged entry keeps the first
token's id/p/t_dtw and extends t1 to the last absorbed token, which
matches how segment text is assembled elsewhere.
Refs #1798
* fix: address review — add braces for consistency, use full issue URL
- Add braces to if/else chain for codebase consistency
- Use full URL for issue #1798 reference
Review: @danbev
---------
Co-authored-by: texasich <texasich@users.noreply.github.com>
Co-authored-by: texasich <texasich@gmail.com>
* common: add memory buffer overload of read_audio_data
whisper-server /inference without --convert passed the uploaded file
bytes to read_audio_data as a filename, so ma_decoder_init_file tried
to open a path starting with "RIFF" and failed. every request returned
HTTP 400 "Invalid request" on builds without WHISPER_FFMPEG, which is
the default.
factor the PCM extraction into a shared helper and add an overload that
decodes straight from a memory buffer via ma_decoder_init_memory, which
the function already used for the stdin path. server now calls it with
the upload content. the filename overload behavior is unchanged.
This commit addresses a memory leak in the `read_audio_data` function
where it is currently possible that a call to `ma_decoder_init_file`
succeeds and the function returns early without calling
`ma_decoder_uninit`. A similar situation can occur with
`ma_decoder_init_memory`.
Refs: https://bugs.debian.org/1124796
Co-authored-by: Daniel Bevenius <daniel.bevenius@gmail.com>
The project moved from ggerganov/ to ggml-org/ and the README already
references the new URL in both places it mentions issue #89 (README.md
and examples/bench/README.md). Syncing the two remaining hardcoded URLs
in examples/bench/bench.cpp and examples/bench.wasm/emscripten.cpp.
The old URL still redirects, so this is cosmetic.
Several error paths in the /inference and /load endpoints returned
HTTP 200 with a JSON error body, making it impossible for clients
to distinguish errors from successful responses by status code.
Set 400 for client errors (missing file field, unreadable audio,
missing/invalid model) and 500 for server errors (ffmpeg conversion
failure). The two existing status-code sites (499 for client
disconnect, 500 for processing failure) are unchanged.