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

background client mvp #62

Merged
merged 2 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
16 changes: 13 additions & 3 deletions faster_whisper_server/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,20 +184,30 @@ class Config(BaseSettings):
"""

default_language: Language | None = None
"""
Default language to use for transcription. If not set, the language will be detected automatically.
It is recommended to set this as it will improve the performance.
"""
default_response_format: ResponseFormat = ResponseFormat.JSON
whisper: WhisperConfig = WhisperConfig()
max_models: int = 1
"""
Maximum number of models that can be loaded at a time.
"""
max_no_data_seconds: float = 1.0
"""
Max duration to for the next audio chunk before transcription is finilized and connection is closed.
Max duration to wait for the next audio chunk before transcription is finilized and connection is closed.
"""
min_duration: float = 1.0
"""
Minimum duration of an audio chunk that will be transcribed.
"""
word_timestamp_error_margin: float = 0.2
max_inactivity_seconds: float = 5.0
max_inactivity_seconds: float = 2.5
"""
Max allowed audio duration without any speech being detected before transcription is finilized and connection is closed.
""" # noqa: E501
inactivity_window_seconds: float = 10.0
inactivity_window_seconds: float = 5.0
"""
Controls how many latest seconds of audio are being passed through VAD.
Should be greater than `max_inactivity_seconds`
Expand Down
17 changes: 14 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,21 @@ dependencies = [
"httpx-sse",
"httpx",
"gradio",
"openai"
"openai",
]

[project.optional-dependencies]
dev = ["ruff==0.5.3", "pytest", "webvtt-py", "srt", "basedpyright==1.13.0", "pytest-xdist"]
client = [
"keyboard",
]
dev = [
"ruff==0.5.3",
"pytest",
"webvtt-py",
"srt",
"basedpyright==1.13.0",
"pytest-xdist"
]

other = ["youtube-dl @ git+https://github.com/ytdl-org/youtube-dl.git@37cea84f775129ad715b9bcd617251c831fcc980", "aider-chat==0.39.0"]

Expand Down Expand Up @@ -58,7 +68,8 @@ ignore = [
"T201", # print
"TRY003",
"W505",
"ISC001" # recommended to disable for formatting
"ISC001", # recommended to disable for formatting
"INP001",
]

[tool.ruff.lint.isort]
Expand Down
68 changes: 23 additions & 45 deletions requirements-all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ aiosignal==1.3.1
altair==5.3.0
# via
# aider-chat
# gradio
# streamlit
annotated-types==0.7.0
# via
Expand All @@ -24,17 +23,17 @@ annotated-types==0.7.0
anyio==4.4.0
# via
# aider-chat
# gradio
# httpx
# openai
# starlette
# watchfiles
attrs==23.2.0
# via
# aider-chat
# aiohttp
# jsonschema
# referencing
av==12.2.0
av==12.3.0
# via faster-whisper
backoff==2.2.1
# via aider-chat
Expand Down Expand Up @@ -91,21 +90,15 @@ distro==1.9.0
# via
# aider-chat
# openai
dnspython==2.6.1
# via email-validator
email-validator==2.2.0
# via fastapi
execnet==2.1.1
# via pytest-xdist
fastapi==0.111.1
fastapi==0.112.2
# via
# faster-whisper-server (pyproject.toml)
# gradio
fastapi-cli==0.0.4
# via fastapi
faster-whisper==1.0.3
# via faster-whisper-server (pyproject.toml)
ffmpy==0.3.2
ffmpy==0.4.0
# via gradio
filelock==3.15.1
# via
Expand Down Expand Up @@ -168,9 +161,9 @@ googleapis-common-protos==1.63.1
# aider-chat
# google-api-core
# grpcio-status
gradio==4.38.1
gradio==4.42.0
# via faster-whisper-server (pyproject.toml)
gradio-client==1.1.0
gradio-client==1.3.0
# via gradio
greenlet==3.0.3
# via
Expand Down Expand Up @@ -201,13 +194,10 @@ httplib2==0.22.0
# aider-chat
# google-api-python-client
# google-auth-httplib2
httptools==0.6.1
# via uvicorn
httpx==0.27.0
# via
# faster-whisper-server (pyproject.toml)
# aider-chat
# fastapi
# gradio
# gradio-client
# openai
Expand All @@ -227,23 +217,21 @@ idna==3.7
# via
# aider-chat
# anyio
# email-validator
# httpx
# requests
# yarl
importlib-metadata==7.1.0
# via
# aider-chat
# litellm
importlib-resources==6.4.0
importlib-resources==6.4.4
# via gradio
iniconfig==2.0.0
# via pytest
jinja2==3.1.4
# via
# aider-chat
# altair
# fastapi
# gradio
# litellm
# pydeck
Expand All @@ -255,6 +243,8 @@ jsonschema-specifications==2023.12.1
# via
# aider-chat
# jsonschema
keyboard==0.13.5
# via faster-whisper-server (pyproject.toml)
kiwisolver==1.4.5
# via matplotlib
litellm==1.40.15
Expand All @@ -268,7 +258,7 @@ markupsafe==2.1.5
# aider-chat
# gradio
# jinja2
matplotlib==3.9.1
matplotlib==3.9.2
# via gradio
mccabe==0.7.0
# via
Expand All @@ -287,7 +277,7 @@ multidict==6.0.5
# yarl
networkx==3.2.1
# via aider-chat
nodejs-wheel-binaries==20.15.1
nodejs-wheel-binaries==20.17.0
# via basedpyright
numpy==1.26.4
# via
Expand All @@ -304,14 +294,14 @@ numpy==1.26.4
# pydeck
# scipy
# streamlit
onnxruntime==1.18.1
onnxruntime==1.19.0
# via faster-whisper
openai==1.34.0
# via
# faster-whisper-server (pyproject.toml)
# aider-chat
# litellm
orjson==3.10.6
orjson==3.10.7
# via gradio
packaging==24.1
# via
Expand Down Expand Up @@ -397,7 +387,7 @@ pydantic-core==2.18.4
# via
# aider-chat
# pydantic
pydantic-settings==2.3.4
pydantic-settings==2.4.0
# via faster-whisper-server (pyproject.toml)
pydeck==0.9.1
# via
Expand All @@ -424,7 +414,7 @@ pyparsing==3.1.2
# aider-chat
# httplib2
# matplotlib
pytest==8.2.2
pytest==8.3.2
# via
# faster-whisper-server (pyproject.toml)
# pytest-xdist
Expand All @@ -440,11 +430,9 @@ python-dotenv==1.0.1
# aider-chat
# litellm
# pydantic-settings
# uvicorn
python-multipart==0.0.9
# via
# faster-whisper-server (pyproject.toml)
# fastapi
# gradio
pytz==2024.1
# via
Expand All @@ -456,7 +444,6 @@ pyyaml==6.0.1
# ctranslate2
# gradio
# huggingface-hub
# uvicorn
referencing==0.35.1
# via
# aider-chat
Expand Down Expand Up @@ -496,7 +483,7 @@ scipy==1.13.1
# via aider-chat
semantic-version==2.10.0
# via gradio
setuptools==71.0.4
setuptools==73.0.1
# via ctranslate2
shellingham==1.5.4
# via typer
Expand Down Expand Up @@ -526,11 +513,11 @@ soupsieve==2.5
# beautifulsoup4
srt==3.5.3
# via faster-whisper-server (pyproject.toml)
starlette==0.37.2
starlette==0.38.2
# via fastapi
streamlit==1.35.0
# via aider-chat
sympy==1.13.1
sympy==1.13.2
# via onnxruntime
tenacity==8.3.0
# via
Expand Down Expand Up @@ -573,10 +560,8 @@ tree-sitter-languages==1.10.2
# via
# aider-chat
# grep-ast
typer==0.12.3
# via
# fastapi-cli
# gradio
typer==0.12.5
# via gradio
typing-extensions==4.12.2
# via
# aider-chat
Expand Down Expand Up @@ -604,27 +589,20 @@ urllib3==2.2.1
# aider-chat
# gradio
# requests
uvicorn==0.30.1
uvicorn==0.30.6
# via
# faster-whisper-server (pyproject.toml)
# fastapi
# gradio
uvloop==0.19.0
# via uvicorn
watchdog==4.0.1
# via
# aider-chat
# streamlit
watchfiles==0.22.0
# via uvicorn
wcwidth==0.2.13
# via
# aider-chat
# prompt-toolkit
websockets==11.0.3
# via
# gradio-client
# uvicorn
websockets==12.0
# via gradio-client
webvtt-py==0.5.1
# via faster-whisper-server (pyproject.toml)
yarl==1.9.4
Expand Down
Loading