Skip to content

Commit d2ac64f

Browse files
committed
faster into api
1 parent 7254182 commit d2ac64f

24 files changed

+615
-0
lines changed

.gitignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
.DS_Store
2+
.idea
3+
*.log
4+
tmp/
5+
6+
*.py[cod]
7+
*.egg
8+
*.egg-info/
9+
build
10+
htmlcov
11+
12+
/.venv/
13+
.mypy_cache/
14+
__pycache__/
15+
16+
/dist/
17+
/local/

.isort.cfg

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[settings]
2+
multi_line_output=3
3+
include_trailing_comma=True
4+
force_grid_wrap=0
5+
use_parentheses=True
6+
line_length=88

.projectile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- /.venv/

LICENSE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 Michael Hansen
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include requirements.txt

README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Wyoming Whisper API client
2+
3+
[Wyoming protocol](https://github.com/rhasspy/wyoming) server for the Whisper API speech to text system.
4+
5+
My motivation was to establish a one working STT system for whole household, additionally to Home Assistant
6+
I use it for Blurt(https://github.com/QuantiusBenignus/blurt#network-transcription)
7+
gnome shell extension.
8+
9+
You need a running Whisper compatible API service, for example Whisper.cpp instance:
10+
11+
https://github.com/ggerganov/whisper.cpp/tree/master/examples/server
12+
13+
I run it on nvidia GPU with fantastic results with detailed inference on large model in usually about a second:
14+
15+
``` sh
16+
whisper.cpp/server -m whisper.cpp/models/ggml-large-v3-q5_0.bin --host 0.0.0.0 --port 8910 --print-realtime --print-progress
17+
```
18+
19+
You need to study whisper.cpp to get more information about running its STT service.
20+
21+
## Local Install
22+
23+
Clone the repository and set up Python virtual environment:
24+
25+
``` sh
26+
git clone https://github.com/ser/wyoming-whisper-api-client
27+
cd wyoming-whisper-api-client
28+
script/setup
29+
```
30+
31+
Run a server anyone can connect to:
32+
``` sh
33+
./script/run --uri tcp://0.0.0.0:7891 --debug --api http://192.168.41.49:8910/inference
34+
```
35+
36+
# Acknowledgements
37+
38+
1. It's a rewrite of Michael Hansen's wyoming-faster-whisper.
39+
2. Tests are not functioning as there is no public Whisper API service to test it out.
40+

mypy.ini

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[mypy]
2+
ignore_missing_imports = true
3+
4+
[mypy-setuptools.*]
5+
ignore_missing_imports = True

pylintrc

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
[MASTER]
2+
ignore=faster_whisper
3+
4+
[MESSAGES CONTROL]
5+
disable=
6+
format,
7+
abstract-method,
8+
cyclic-import,
9+
duplicate-code,
10+
global-statement,
11+
import-outside-toplevel,
12+
inconsistent-return-statements,
13+
locally-disabled,
14+
not-context-manager,
15+
too-few-public-methods,
16+
too-many-arguments,
17+
too-many-branches,
18+
too-many-instance-attributes,
19+
too-many-lines,
20+
too-many-locals,
21+
too-many-public-methods,
22+
too-many-return-statements,
23+
too-many-statements,
24+
too-many-boolean-expressions,
25+
unnecessary-pass,
26+
unused-argument,
27+
broad-except,
28+
too-many-nested-blocks,
29+
invalid-name,
30+
unused-import,
31+
fixme,
32+
useless-super-delegation,
33+
missing-module-docstring,
34+
missing-class-docstring,
35+
missing-function-docstring,
36+
import-error,
37+
consider-using-with
38+
39+
[FORMAT]
40+
expected-line-ending-format=LF

requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
wyoming
2+
httpx

requirements_dev.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
black==22.12.0
2+
flake8==6.0.0
3+
isort==5.11.3
4+
mypy==0.991
5+
pylint==2.15.9
6+
pytest==7.4.4
7+
pytest-asyncio==0.23.3

0 commit comments

Comments
 (0)