* 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
|
||
|---|---|---|
| .. | ||
| prompts | ||
| .gitignore | ||
| CMakeLists.txt | ||
| README.md | ||
| eleven-labs.py | ||
| speak | ||
| speak.bat | ||
| speak.ps1 | ||
| talk-llama.cpp | ||
README.md
whisper.cpp/examples/talk-llama
Talk with an LLaMA AI in your terminal
Latest perf as of 2 Nov 2023 using Whisper Medium + LLaMA v2 13B Q8_0 on M2 Ultra:
https://github.com/ggerganov/whisper.cpp/assets/1991296/d97a3788-bf2a-4756-9a43-60c6b391649e
Previous demo running on CPUs
Building
The whisper-talk-llama tool depends on SDL2 library to capture audio from the microphone. You can build it like this:
# Install SDL2
# On Debian based linux distributions:
sudo apt-get install libsdl2-dev
# On Fedora Linux:
sudo dnf install SDL2 SDL2-devel
# Install SDL2 on Mac OS
brew install sdl2
# Build the "whisper-talk-llama" executable
cmake -B build -S . -DWHISPER_SDL2=ON
cmake --build build --config Release
# Run it
./build/bin/whisper-talk-llama -mw ./models/ggml-small.en.bin -ml ../llama.cpp/models/llama-13b/ggml-model-q4_0.gguf -p "Georgi" -t 8
- The
-mwargument specifies the Whisper model that you would like to use. Recommendedbaseorsmallfor real-time experience - The
-mlargument specifies the LLaMA model that you would like to use. Read the instructions in https://github.com/ggerganov/llama.cpp for information about how to obtain aggmlcompatible LLaMA model
Session
The whisper-talk-llama tool supports session management to enable more coherent and continuous conversations. By maintaining context from previous interactions, it can better understand and respond to user requests in a more natural way.
To enable session support, use the --session FILE command line option when running the program. The whisper-talk-llama model state will be saved to the specified file after each interaction. If the file does not exist, it will be created. If the file exists, the model state will be loaded from it, allowing you to resume a previous session.
This feature is especially helpful for maintaining context in long conversations or when interacting with the AI assistant across multiple sessions. It ensures that the assistant remembers the previous interactions and can provide more relevant and contextual responses.
Example usage:
./build/bin/whisper-talk-llama --session ./my-session-file -mw ./models/ggml-small.en.bin -ml ../llama.cpp/models/llama-13b/ggml-model-q4_0.gguf -p "Georgi" -t 8
TTS
For best experience, this example needs a TTS tool to convert the generated text responses to voice.
You can use any TTS engine that you would like - simply edit the speak script to your needs.
By default, it is configured to use MacOS's say or Windows SpeechSynthesizer, but you can use whatever you wish.
Discussion
If you have any feedback, please let "us" know in the following discussion: https://github.com/ggerganov/whisper.cpp/discussions/672?converting=1