File tree Expand file tree Collapse file tree 3 files changed +83
-3
lines changed Expand file tree Collapse file tree 3 files changed +83
-3
lines changed Original file line number Diff line number Diff line change 1+ # whisper.cpp.py
2+
3+ Python wrapper around [ whisper.cpp] ( https://github.com/ggml-org/whisper.cpp ) server.
4+
5+ ## Installation
6+
7+ This package requires [ whisper.cpp] ( https://github.com/ggml-org/whisper.cpp ) to be installed manually.
8+
9+ ``` bash
10+ uv add " git+https://github.com/zigai/whisper.cpp.py.git"
11+ ```
12+
13+ ``` bash
14+ pip install git+https://github.com/zigai/whisper.cpp.py
15+ ```
16+
17+ ## Usage
18+
19+ ``` python
20+ from whispercpppy import WhisperCppServer, WhisperCppServerOptions
21+
22+ opts = WhisperCppServerOptions()
23+ whisper = WhisperCppServer(opts)
24+
25+ transcript = whisper.inference(" /path/to/audio/or/video/file" )
26+ ```
27+
28+ ## GGUF model download helper
29+
30+ ```
31+ whisper-cpp-download --help
32+ usage: whisper-cpp-download [-h] [-d] [-o] [-t] models [models ...]
33+
34+ download whisper.cpp GGUF models
35+
36+ available models:
37+ - tiny
38+ - tiny.en
39+ - tiny-q5_1
40+ - tiny.en-q5_1
41+ - tiny-q8_0
42+ - base
43+ - base.en
44+ - base-q5_1
45+ - base.en-q5_1
46+ - base-q8_0
47+ - small
48+ - small.en
49+ - small.en-tdrz
50+ - small-q5_1
51+ - small.en-q5_1
52+ - small-q8_0
53+ - medium
54+ - medium.en
55+ - medium-q5_0
56+ - medium.en-q5_0
57+ - medium-q8_0
58+ - large-v1
59+ - large-v2
60+ - large-v2-q5_0
61+ - large-v2-q8_0
62+ - large-v3
63+ - large-v3-q5_0
64+ - large-v3-turbo
65+ - large-v3-turbo-q5_0
66+ - large-v3-turbo-q8_0
67+
68+ positional arguments:
69+ models model names
70+
71+ options:
72+ -h, --help show this help message and exit
73+ -d, --dir save directory for models. defaults to the path set by WHISPERCPP_MODELS_DIR env var or the current directory if not set.
74+ -o, --overwrite overwrite the file if it already exists.
75+ -t, --timeout timeout for the download request in seconds
76+ ```
77+
78+ ## License
79+
80+ [ MIT License] ( https://github.com/zigai/whisper.cpp.py/blob/master/LICENSE )
Original file line number Diff line number Diff line change @@ -22,8 +22,7 @@ def build_parser() -> argparse.ArgumentParser:
2222 dest = "directory" ,
2323 type = Path ,
2424 help = (
25- "save directory for models. "
26- "defaults to the path set by WHISPERCPP_MODELS_DIR or the current directory."
25+ "save directory for models. defaults to the path set by WHISPERCPP_MODELS_DIR env var or the current directory if not set"
2726 ),
2827 metavar = "\b " ,
2928 )
@@ -63,3 +62,4 @@ def cli() -> int:
6362
6463if __name__ == "__main__" :
6564 cli ()
65+ cli ()
Original file line number Diff line number Diff line change @@ -184,7 +184,7 @@ class WhisperCppServer:
184184 def __init__ (
185185 self ,
186186 server_options : WhisperCppServerOptions ,
187- vad_options : VoiceActivityDetectionOptions | None ,
187+ vad_options : VoiceActivityDetectionOptions | None = None ,
188188 binary : str = "whisper-server" ,
189189 autostart : bool = False ,
190190 ready_timeout_s : float | None = 30.0 ,
You can’t perform that action at this time.
0 commit comments