Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setup_logger to use config.log_level for basicConfig #126

Open
wants to merge 132 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
132 commits
Select commit Hold shift + click to select a range
234861a
docs: add youtube example
May 27, 2024
301743f
docs: add live-transcription demo
May 27, 2024
421afe3
chore: update inactivity defaults
May 27, 2024
eb27202
Update README.md
fedirz May 27, 2024
dceeaa8
Update README.md
fedirz May 27, 2024
c11b8d4
deps: re-install faster_whisper, fixing ctranslate2
May 30, 2024
2a4f185
chore: add lsyncd config
Jun 2, 2024
e1139e0
chore: add docker compose watch attribute
Jun 2, 2024
b67a33b
deps: upgrade python to 3.12
Jun 2, 2024
d3d2e31
chore: add vtt and str output examples
Jun 2, 2024
28455ee
deps: add huggingface-hub
Jun 2, 2024
1475c03
feat: allow using any ctraslate2 compatible model #14
Jun 2, 2024
93b299d
feat: add /v1/models and /v1/model routes #14
Jun 2, 2024
8cdaa85
deps: add httpx-sse dev
Jun 2, 2024
1c2e658
fix: streaming doesn't use sse #15
Jun 2, 2024
31cbeb3
ci: update how images are tagged, enable multi-arch builds
Jun 3, 2024
40cedac
chore: update docker tag to latest
Jun 3, 2024
a83bc4f
chore: handle "whisper-1" model name
Jun 12, 2024
3567830
fix: timestamp_granularities remove plural form
Jun 13, 2024
9a22b54
chore: improve api docs
Jun 13, 2024
a7e94e8
deps: add aider
Jun 22, 2024
eebe370
extract segments to response logic
Jun 22, 2024
a1972b6
deps: add gradio
Jun 22, 2024
45f4cbf
feat: add a playground
Jun 22, 2024
5f3abbc
misc: tests
Jun 22, 2024
4488c55
misc: remove custom pre-commit ruff hooks
Jun 22, 2024
6d1e3d2
move deps
Jun 23, 2024
6168164
fix task enum vals, fix env var parsing, improve gradio, use uv in do…
Jun 23, 2024
25bc9d3
Update README.md
fedirz Jun 26, 2024
3aa2245
chore: update .gitignore
Jul 3, 2024
73fd866
switch to using uv
Jul 3, 2024
4a5533a
update pre-commit deps, replace custom pyright hook
Jul 3, 2024
c9adb84
deps: add ruff
Jul 3, 2024
702970b
chore: fix ruff errors
Jul 3, 2024
d73cba4
fix: models route returning non-asr models
Jul 3, 2024
d64b760
fix: models route not returning openai compatible response
Jul 3, 2024
968afc2
chore: update model(s) route tests
Jul 3, 2024
8aeab1f
feat: add language field to the model response type
Jul 3, 2024
93d15f3
chore: return the models sorted by the number of downloads
Jul 3, 2024
bb6253f
chore: gradio use openai client to list models
Jul 3, 2024
f5e4ada
chore: delete failing tests
Jul 3, 2024
c7a6a7e
ci: add lint action
Jul 3, 2024
2fa0eb7
fix: VAD error caused by new major numpy version
Jul 3, 2024
a4bb723
ci: add test action
Jul 3, 2024
73a2e37
feat: support hotwords
Jul 3, 2024
090c064
Update README.md
fedirz Jul 3, 2024
08cf0b0
f string dobule quotes to single quotes to make it work on python 3.11
shhossain Jul 9, 2024
458d971
docs: add js example
Jul 16, 2024
178b540
deps: update
Jul 16, 2024
5449f92
fix: lint errors
Jul 16, 2024
4efd3c6
fix: Correct closing logic in AudioStream to prevent discarding remai…
GrisaiaEvy Jul 17, 2024
ddbf22b
switch to basedpyright
Jul 19, 2024
e1bf75a
refactor
Jul 20, 2024
4287fa4
feat: add flag to disable/enable ui
Jul 20, 2024
17df097
docs: fix shell quote
Jul 20, 2024
166eb43
refactor
Jul 20, 2024
60b1dbe
feat: handle srt and vtt response formats
Jul 20, 2024
a2aafe4
feat: add CORS support, loaded from CORS_ORIGINS in env
braden-w Aug 8, 2024
7691978
update cors pr
Aug 10, 2024
2e89bc9
chore: update ruff target version
Aug 13, 2024
1f4e7ea
chore: update default log level
Aug 13, 2024
0a02cb5
fix: incorrect whisper model env references
Aug 13, 2024
ad4e94d
chore: log config on startup
Aug 13, 2024
ed6da33
chore: add a more descriptive assert error message (#58)
Aug 27, 2024
f46133f
feat: add mvp client which runs in the background
Aug 21, 2024
000ea9d
chore: adjust live transcription defaults and add descriptions
Aug 27, 2024
2f6a1bc
chore: expose additional config options (#51)
Aug 27, 2024
210dab4
chore: expose additional config options (#51) pt2
Aug 27, 2024
9b25259
Update script.sh
slaesh Aug 31, 2024
6db95d3
add tutorial for kubernetes
samos123 Sep 3, 2024
da69403
chore: minor changes to scripts/client.py
Sep 2, 2024
ad29eba
fix: cuda not working on nixos
Sep 5, 2024
e4e62ca
chore: remove `lsyncd`
Sep 5, 2024
87d5890
feat: support model preloading (#66)
Sep 5, 2024
220ad22
feat: ollama-like ps endpoints
Sep 5, 2024
d8adec9
deps: remove `other`
Sep 6, 2024
94ff547
deps: update flake
Sep 6, 2024
c128379
feat: use `uv` package manager, pin dependencies
Sep 8, 2024
b2dd781
docs: docker compose document CDI cuda usage
Sep 8, 2024
b824fc3
chore: update default whisper model
Sep 7, 2024
045fee3
feat: api route to download model
Sep 7, 2024
b52eef5
chore: add `hf_utils` module
Sep 7, 2024
d80bb2d
chore: update docker compose to use volume instead of bind mount for …
Sep 7, 2024
62c6333
deps: add `pytest-async`
Sep 7, 2024
7afca8c
ci: run test job on macos (arm)
Sep 8, 2024
3df8751
wip
Sep 8, 2024
88a6537
Revert "wip"
Sep 8, 2024
8aae91b
chore: disable gradio telemetry
Sep 8, 2024
ef51167
chore: set root logger level to info
Sep 8, 2024
fa611e5
chore: format compose
Sep 10, 2024
88a61dd
fix: gradio pydantic error
Sep 10, 2024
dd433c6
docs: mention quantization example for env variable
thiswillbeyourgithub Sep 14, 2024
732eb88
fix: 404
thiswillbeyourgithub Sep 14, 2024
069cd91
refactor: add `ModelManager`
Sep 20, 2024
fed81f1
refactor: split out app into multiple router modules
Sep 20, 2024
209f46b
feat: dependency injection
Sep 20, 2024
2a099cf
fix: pytest-asyncio fixture scope warnings
Sep 21, 2024
4cb006f
test: capture openai's param handling
Sep 21, 2024
5cbc876
test: switch to async openai client
Sep 21, 2024
98d6f0d
fix: `timestamp_granularities[]` handling (#28, #58, #81)
Sep 21, 2024
748b9ef
ci: do not run tests which require OpenAI API key
Sep 21, 2024
0081250
fix: pre-commit basedpyright not checking all files
Sep 30, 2024
9d909b5
refactor: update response model names and module name
Sep 30, 2024
5c0cc5c
test: switch to async http client
Sep 30, 2024
312f9e8
chore: fix some ruff errors
Sep 30, 2024
25b39fa
deps: update flake
Sep 30, 2024
d4dfaab
deps: update python packages
Sep 30, 2024
ecbd5b8
fix: dockerfile command not using app factory
Sep 30, 2024
1af5898
deps: move ui packages to a separate group
Sep 30, 2024
7f36990
misc: add `vad_filter` form field
Sep 30, 2024
1a02399
chore: auto-fix ruff errors
Sep 30, 2024
caba05a
feat: model unloading
Sep 30, 2024
7723ee9
Update README.md
fedirz Oct 1, 2024
3dcd817
chore: misc changes
Oct 2, 2024
d651aba
docs: initialize mkdocs
Oct 2, 2024
f6ebaff
typos
neuhaus Oct 2, 2024
60efb15
docs: update README.md
eltociear Oct 1, 2024
b07f305
Update README.md
kushal34712 Oct 3, 2024
f74cf43
Update Dockerfile.cpu
wuast94 Oct 8, 2024
b297bc4
Update Dockerfile.cuda
wuast94 Oct 8, 2024
ab29feb
Update README.md
Innovatorcloudy Oct 4, 2024
19d3216
Improved readability in README.md
JeevaRamanathan Oct 3, 2024
99d0641
Add renovate.json
renovate[bot] Oct 12, 2024
a92fa4e
ci: limit when GHA jobs run
Oct 12, 2024
6f0b227
Add `pre-commit` to pyproject.toml
Oct 12, 2024
b8eb26a
No longer set `WHISPER__INFERENCE_DEVICE` in Dockerfiles (#113)
Oct 12, 2024
1b5fa0e
chore(deps): update ubuntu docker tag to v24
renovate[bot] Oct 12, 2024
98d281f
chore(deps): update docker/build-push-action action to v6
renovate[bot] Oct 12, 2024
c14934d
chore(deps): update astral-sh/setup-uv action to v3
renovate[bot] Oct 12, 2024
500f832
chore(deps): update ghcr.io/astral-sh/uv docker tag to v0.4.20
renovate[bot] Oct 12, 2024
02d4ced
deps: upgrade gradio to v5
Oct 12, 2024
68b9f6d
setup_logger to use config.log_level for basicConfig
EricLiclair Oct 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions .github/workflows/docker-build-and-push.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
name: docker-build-and-push

on:
workflow_dispatch:
push:
tags:
- 'v*'
release:
types: [published]

env:
IMAGE_NAME: fedirz/faster-whisper-server
jobs:
docker:
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
strategy:
matrix:
dockerfile: [Dockerfile.cuda, Dockerfile.cpu]
Expand All @@ -21,33 +21,33 @@ jobs:
tag-suffix: -cpu
steps:
- uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- id: meta
uses: docker/metadata-action@v5
with:
images: |
fedirz/faster-whisper-server
${{ env.IMAGE_NAME }}
# https://github.com/docker/metadata-action?tab=readme-ov-file#flavor-input
flavor: |
latest=false
suffix=${{ matrix.tag-suffix}}
suffix=${{ matrix.tag-suffix}},onlatest=true
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}.{{patch}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: .
file: ${{ matrix.dockerfile }}
push: true
# TODO:
# platforms: linux/amd64,linux/arm64
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
cache-from: type=registry,ref=fedirz/faster-whisper-server:buildcache
cache-to: type=registry,ref=fedirz/faster-whisper-server:buildcache,mode=max
cache-from: type=registry,ref=${{ env.IMAGE_NAME }}:buildcache
cache-to: type=registry,ref=${{ env.IMAGE_NAME }}:buildcache,mode=max
30 changes: 30 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: lint
on:
workflow_dispatch:
push:
branches:
- master
paths:
- "src/**"
- "scripts/**"
- "tests/**"
- ".github/workflows/lint.yaml"
pull_request:
paths:
- "src/**"
- "scripts/**"
- "tests/**"
- ".github/workflows/lint.yaml"
jobs:
ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v3
with:
version: "0.4.11"
enable-cache: true
- run: uv python install 3.12
- run: uv sync --extra dev
- run: uv run ruff check .
- run: uv run ruff format --check --diff .
31 changes: 31 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: test
on:
workflow_dispatch:
push:
branches:
- master
paths:
- "src/**"
- "tests/**"
- ".github/workflows/test.yaml"
pull_request:
paths:
- "src/**"
- "tests/**"
- ".github/workflows/test.yaml"
jobs:
pytest:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v3
with:
version: "0.4.11"
enable-cache: true
- run: uv python install 3.12
- run: uv sync --all-extras
# TODO: figure out why `pytest` doesn't discover tests in `faster_whisper_server` directory by itself
- run: uv run pytest -m "not requires_openai" src/faster_whisper_server/* tests
169 changes: 166 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,171 @@
__pycache__
.pytest_cache
# https://github.com/github/gitignore/blob/main/Python.gitignore
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
.pdm.toml
.pdm-python
.pdm-build/

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

# My additions
tests/data
.direnv
.task
.secrets
.ruff_cache
.env
.aider*
43 changes: 18 additions & 25 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,47 +2,40 @@
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.28.4
rev: 0.28.6
hooks:
- id: check-taskfile
- repo: https://github.com/rhysd/actionlint
rev: v1.7.0
rev: v1.7.1
hooks:
- id: actionlint
- repo: https://github.com/IamTheFij/docker-pre-commit
rev: v3.0.1
hooks:
- id: docker-compose-check
- repo: https://github.com/hadolint/hadolint
rev: v2.12.0
rev: v2.13.0-beta
hooks:
- id: hadolint
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.10.0.1
hooks:
- id: shellcheck
# NOTE: not using https://github.com/RobertCraigie/pyright-python because it doesn't work with poetry virtual environments
# NOTE: not using github.com/astral-sh/ruff-pre-commit because it doesn't work on NixOS
- repo: local
hooks:
- id: pyright
name: pyright
entry: ./pre-commit-scripts/pyright.sh
language: script
pass_filenames: false
- id: ruff-lint
name: ruff-lint
entry: ./pre-commit-scripts/ruff-lint.sh
pass_filenames: false
language: script
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.0
hooks:
- id: ruff
args: [--fix]
- id: ruff-format
name: ruff-format
entry: ./pre-commit-scripts/ruff-format.sh
language: script
- repo: https://github.com/google/yamlfmt
rev: v0.13.0
hooks:
- id: yamlfmt
- repo: https://github.com/DetachHead/basedpyright-pre-commit-mirror
rev: v1.13.0
hooks:
- id: basedpyright
pass_filenames: false
Loading