Skip to content

Commit 14a3e16

Browse files
committed
whisper : rename binaries + fix install
1 parent e4e0598 commit 14a3e16

Some content is hidden

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

44 files changed

+171
-3921
lines changed

README.md

Lines changed: 26 additions & 263 deletions
Large diffs are not rendered by default.

examples/CMakeLists.txt

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -97,52 +97,33 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR})
9797

9898
if (EMSCRIPTEN)
9999
add_subdirectory(whisper.wasm)
100-
set_target_properties(libmain PROPERTIES FOLDER "libs")
101100
add_subdirectory(stream.wasm)
102-
set_target_properties(libstream PROPERTIES FOLDER "libs")
103101
add_subdirectory(command.wasm)
104-
set_target_properties(libcommand PROPERTIES FOLDER "libs")
105-
#add_subdirectory(talk.wasm)
106-
#set_target_properties(libtalk PROPERTIES FOLDER "libs")
107102
add_subdirectory(bench.wasm)
108-
set_target_properties(libbench PROPERTIES FOLDER "libs")
109103
elseif(CMAKE_JS_VERSION)
110104
add_subdirectory(addon.node)
111-
set_target_properties(addon.node PROPERTIES FOLDER "examples")
112105
else()
113-
add_subdirectory(main)
114-
set_target_properties(main PROPERTIES FOLDER "examples")
106+
add_subdirectory(cli)
115107
if (WHISPER_SDL2)
116108
add_subdirectory(stream)
117-
set_target_properties(stream PROPERTIES FOLDER "examples")
118109
endif (WHISPER_SDL2)
119110
add_subdirectory(server)
120-
set_target_properties(server PROPERTIES FOLDER "examples")
121111
if (WHISPER_SDL2)
122112
add_subdirectory(command)
123-
set_target_properties(command PROPERTIES FOLDER "examples")
124113
endif (WHISPER_SDL2)
125114
add_subdirectory(bench)
126-
set_target_properties(bench PROPERTIES FOLDER "examples")
127115
add_subdirectory(quantize)
128-
set_target_properties(quantize PROPERTIES FOLDER "examples")
129116
if (WHISPER_SDL2)
130-
# TODO: disabled until update
131-
# https://github.com/ggerganov/whisper.cpp/issues/1818
132-
#add_subdirectory(talk)
133-
#set_target_properties(talk PROPERTIES FOLDER "examples")
134117
add_subdirectory(talk-llama)
135-
set_target_properties(talk-llama PROPERTIES FOLDER "examples")
136118
add_subdirectory(lsp)
137-
set_target_properties(lsp PROPERTIES FOLDER "examples")
138119
if (GGML_SYCL)
139120
add_subdirectory(sycl)
140-
set_target_properties(ls-sycl-device PROPERTIES FOLDER "examples")
141121
endif()
142122
endif (WHISPER_SDL2)
143123
endif()
144124

145125
if (WHISPER_SDL2)
146126
add_subdirectory(wchess)
147-
set_target_properties(wchess PROPERTIES FOLDER "examples")
148127
endif (WHISPER_SDL2)
128+
129+
add_subdirectory(deprecation-warning)

examples/bench/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
set(TARGET bench)
1+
set(TARGET whisper-bench)
22
add_executable(${TARGET} bench.cpp)
33

44
include(DefaultTargetOptions)
55

66
target_link_libraries(${TARGET} PRIVATE whisper ${CMAKE_THREAD_LIBS_INIT})
7+
8+
install(TARGETS ${TARGET} RUNTIME)

examples/bench/README.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# bench
1+
# whisper.cpp/examples/bench
22

33
A very basic tool for benchmarking the inference performance on your device. The tool simply runs the Encoder part of
44
the transformer on some random audio data and records the execution time. This way we can have an objective comparison
@@ -7,11 +7,8 @@ of the performance of the model for various setups.
77
Benchmark results are tracked in the following Github issue: https://github.com/ggerganov/whisper.cpp/issues/89
88

99
```bash
10-
# build the bench tool
11-
$ make bench
12-
13-
# run it on the small.en model using 4 threads
14-
$ ./bench -m ./models/ggml-small.en.bin -t 4
10+
# run the bench too on the small.en model using 4 threads
11+
$ ./build/bin/whisper-bench -m ./models/ggml-small.en.bin -t 4
1512

1613
whisper_model_load: loading model from './models/ggml-small.en.bin'
1714
whisper_model_load: n_vocab = 51864
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
set(TARGET main)
2-
add_executable(${TARGET} main.cpp)
1+
set(TARGET whisper-cli)
2+
add_executable(${TARGET} cli.cpp)
33

44
include(DefaultTargetOptions)
55

66
target_link_libraries(${TARGET} PRIVATE common whisper ${FFMPEG_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
7+
8+
install(TARGETS ${TARGET} RUNTIME)

examples/main/README.md renamed to examples/cli/README.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# main
1+
# whisper.cpp/examples/cli
22

33
This is the main example demonstrating most of the functionality of the Whisper model.
44
It can be used as a reference for using the `whisper.cpp` library in other projects.
55

66
```
7-
./main -h
7+
./build/bin/whisper-cli -h
88
9-
usage: ./main [options] file0.wav file1.wav ...
9+
usage: ./build-pkg/bin/whisper-cli [options] file0.wav file1.wav ...
1010
1111
options:
1212
-h, --help [default] show this help message and exit
@@ -20,9 +20,12 @@ options:
2020
-sow, --split-on-word [false ] split on word rather than on token
2121
-bo N, --best-of N [5 ] number of best candidates to keep
2222
-bs N, --beam-size N [5 ] beam size for beam search
23+
-ac N, --audio-ctx N [0 ] audio context size (0 - all)
2324
-wt N, --word-thold N [0.01 ] word timestamp probability threshold
2425
-et N, --entropy-thold N [2.40 ] entropy threshold for decoder fail
2526
-lpt N, --logprob-thold N [-1.00 ] log probability threshold for decoder fail
27+
-tp, --temperature N [0.00 ] The sampling temperature, between 0 and 1
28+
-tpi, --temperature-inc N [0.20 ] The increment of temperature, between 0 and 1
2629
-debug, --debug-mode [false ] enable debug mode (eg. dump log_mel)
2730
-tr, --translate [false ] translate from source language to english
2831
-di, --diarize [false ] stereo audio diarization
@@ -38,16 +41,23 @@ options:
3841
-oj, --output-json [false ] output result in a JSON file
3942
-ojf, --output-json-full [false ] include more information in the JSON file
4043
-of FNAME, --output-file FNAME [ ] output file path (without file extension)
44+
-np, --no-prints [false ] do not print anything other than the results
4145
-ps, --print-special [false ] print special tokens
4246
-pc, --print-colors [false ] print colors
4347
-pp, --print-progress [false ] print progress
4448
-nt, --no-timestamps [false ] do not print timestamps
4549
-l LANG, --language LANG [en ] spoken language ('auto' for auto-detect)
4650
-dl, --detect-language [false ] exit after automatically detecting language
47-
--prompt PROMPT [ ] initial prompt
51+
--prompt PROMPT [ ] initial prompt (max n_text_ctx/2 tokens)
4852
-m FNAME, --model FNAME [models/ggml-base.en.bin] model path
4953
-f FNAME, --file FNAME [ ] input WAV file path
5054
-oved D, --ov-e-device DNAME [CPU ] the OpenVINO device used for encode inference
55+
-dtw MODEL --dtw MODEL [ ] compute token-level timestamps
5156
-ls, --log-score [false ] log best decoder scores of tokens
5257
-ng, --no-gpu [false ] disable GPU
58+
-fa, --flash-attn [false ] flash attention
59+
--suppress-regex REGEX [ ] regular expression matching tokens to suppress
60+
--grammar GRAMMAR [ ] GBNF grammar to guide decoding
61+
--grammar-rule RULE [ ] top-level GBNF grammar rule name
62+
--grammar-penalty N [100.0 ] scales down logits of nongrammar tokens
5363
```
File renamed without changes.

examples/command/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
if (WHISPER_SDL2)
2-
# command
3-
set(TARGET command)
2+
set(TARGET whisper-command)
43
add_executable(${TARGET} command.cpp)
54

65
include(DefaultTargetOptions)
76

87
target_link_libraries(${TARGET} PRIVATE common common-sdl whisper ${CMAKE_THREAD_LIBS_INIT})
8+
9+
install(TARGETS ${TARGET} RUNTIME)
910
endif ()

examples/command/README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
# command
1+
# whisper.cpp/examples/command
22

33
This is a basic Voice Assistant example that accepts voice commands from the microphone.
44
More info is available in [issue #171](https://github.com/ggerganov/whisper.cpp/issues/171).
55

66
```bash
77
# Run with default arguments and small model
8-
./command -m ./models/ggml-small.en.bin -t 8
8+
./whisper-command -m ./models/ggml-small.en.bin -t 8
99

1010
# On Raspberry Pi, use tiny or base models + "-ac 768" for better performance
11-
./command -m ./models/ggml-tiny.en.bin -ac 768 -t 3 -c 0
11+
./whisper-command -m ./models/ggml-tiny.en.bin -ac 768 -t 3 -c 0
1212
```
1313

1414
https://user-images.githubusercontent.com/1991296/204038393-2f846eae-c255-4099-a76d-5735c25c49da.mp4
@@ -23,18 +23,18 @@ Initial tests show that this approach might be extremely efficient in terms of p
2323

2424
```bash
2525
# Run in guided mode, the list of allowed commands is in commands.txt
26-
./command -m ./models/ggml-base.en.bin -cmd ./examples/command/commands.txt
26+
./whisper-command -m ./models/ggml-base.en.bin -cmd ./examples/command/commands.txt
2727

2828
# On Raspberry Pi, in guided mode you can use "-ac 128" for extra performance
29-
./command -m ./models/ggml-tiny.en.bin -cmd ./examples/command/commands.txt -ac 128 -t 3 -c 0
29+
./whisper-command -m ./models/ggml-tiny.en.bin -cmd ./examples/command/commands.txt -ac 128 -t 3 -c 0
3030
```
3131

3232
https://user-images.githubusercontent.com/1991296/207435352-8fc4ed3f-bde5-4555-9b8b-aeeb76bee969.mp4
3333

3434

3535
## Building
3636

37-
The `command` tool depends on SDL2 library to capture audio from the microphone. You can build it like this:
37+
The `whisper-command` tool depends on SDL2 library to capture audio from the microphone. You can build it like this:
3838

3939
```bash
4040
# Install SDL2
@@ -47,5 +47,6 @@ sudo dnf install SDL2 SDL2-devel
4747
# Install SDL2 on Mac OS
4848
brew install sdl2
4949

50-
make command
50+
cmake -B build -DWHISPER_SDL2=ON
51+
cmake --build build --config Release
5152
```
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
add_executable(main ./deprecation-warning.cpp)
2+
add_executable(bench ./deprecation-warning.cpp)
3+
add_executable(stream ./deprecation-warning.cpp)
4+
add_executable(command ./deprecation-warning.cpp)

0 commit comments

Comments
 (0)