• Y
  • List All
  • Feedback
    • This Project
    • All Projects
Profile Account settings Log out
  • Favorite
  • Project
  • All
Loading...
  • Log in
  • Sign up
yjyoon / whisper_server_speaches star
  • Project homeH
  • CodeC
  • IssueI
  • Pull requestP
  • Review R
  • MilestoneM
  • BoardB
  • Files
  • Commit
  • Branches
whisper_server_speachessrcspeachesmain.py
Download as .zip file
File name
Commit message
Commit date
.github/workflows
feat: switch to ghcr.io
01-10
configuration
feat: add instrumentation
2024-12-17
docs
rename to `speaches`
01-12
examples
rename to `speaches`
01-12
scripts
chore: misc changes
2024-10-03
src/speaches
rename to `speaches`
01-12
tests
rename to `speaches`
01-12
.dockerignore
chore: update .dockerignore
2024-11-01
.envrc
init
2024-05-20
.gitattributes
chore(deps): update pre-commit hook astral-sh/ruff-pre-commit to v0.7.2
2024-11-02
.gitignore
chore: update .gitignore
2024-07-03
.pre-commit-config.yaml
chore(deps): update pre-commit hook google/yamlfmt to v0.15.0
01-12
Dockerfile
chore(deps): update ghcr.io/astral-sh/uv docker tag to v0.5.18
01-12
LICENSE
init
2024-05-20
README.md
rename to `speaches`
01-12
Taskfile.yaml
rename to `speaches`
01-12
audio.wav
chore: update volume names and mount points
01-10
compose.cpu.yaml
rename to `speaches`
01-12
compose.cuda-cdi.yaml
rename to `speaches`
01-12
compose.cuda.yaml
rename to `speaches`
01-12
compose.observability.yaml
chore(deps): update otel/opentelemetry-collector-contrib docker tag to v0.117.0
01-12
compose.yaml
rename to `speaches`
01-12
flake.lock
deps: update flake
2024-11-01
flake.nix
chore(deps): add loki and tempo package to flake
2024-12-17
mkdocs.yml
rename to `speaches`
01-12
pyproject.toml
rename to `speaches`
01-12
renovate.json
feat: renovate handle pre-commit
2024-11-01
uv.lock
rename to `speaches`
01-12
File name
Commit message
Commit date
routers
rename to `speaches`
01-12
__init__.py
rename to `speaches`
01-12
api_models.py
rename to `speaches`
01-12
asr.py
rename to `speaches`
01-12
audio.py
rename to `speaches`
01-12
config.py
rename to `speaches`
01-12
dependencies.py
rename to `speaches`
01-12
gradio_app.py
rename to `speaches`
01-12
hf_utils.py
rename to `speaches`
01-12
logger.py
rename to `speaches`
01-12
main.py
rename to `speaches`
01-12
model_manager.py
rename to `speaches`
01-12
text_utils.py
rename to `speaches`
01-12
text_utils_test.py
rename to `speaches`
01-12
transcriber.py
rename to `speaches`
01-12
Fedir Zadniprovskyi 01-12 4d66d35 rename to `speaches` UNIX
Raw Open in browser Change history
from __future__ import annotations from contextlib import asynccontextmanager import logging import platform from typing import TYPE_CHECKING from fastapi import ( FastAPI, ) from fastapi.middleware.cors import CORSMiddleware from speaches.dependencies import ApiKeyDependency, get_config, get_model_manager from speaches.logger import setup_logger from speaches.routers.misc import ( router as misc_router, ) from speaches.routers.models import ( router as models_router, ) from speaches.routers.stt import ( router as stt_router, ) if TYPE_CHECKING: from collections.abc import AsyncGenerator # https://swagger.io/docs/specification/v3_0/grouping-operations-with-tags/ # https://fastapi.tiangolo.com/tutorial/metadata/#metadata-for-tags TAGS_METADATA = [ {"name": "automatic-speech-recognition"}, {"name": "speech-to-text"}, {"name": "models"}, {"name": "diagnostic"}, { "name": "experimental", "description": "Not meant for public use yet. May change or be removed at any time.", }, ] def create_app() -> FastAPI: config = get_config() # HACK setup_logger(config.log_level) logger = logging.getLogger(__name__) logger.debug(f"Config: {config}") if platform.machine() == "x86_64": from speaches.routers.speech import ( router as speech_router, ) else: logger.warning("`/v1/audio/speech` is only supported on x86_64 machines") speech_router = None model_manager = get_model_manager() # HACK @asynccontextmanager async def lifespan(_app: FastAPI) -> AsyncGenerator[None, None]: for model_name in config.preload_models: model_manager.load_model(model_name) yield dependencies = [] if config.api_key is not None: dependencies.append(ApiKeyDependency) app = FastAPI(lifespan=lifespan, dependencies=dependencies, openapi_tags=TAGS_METADATA) app.include_router(stt_router) app.include_router(models_router) app.include_router(misc_router) if speech_router is not None: app.include_router(speech_router) if config.allow_origins is not None: app.add_middleware( CORSMiddleware, allow_origins=config.allow_origins, allow_credentials=True, allow_methods=["*"], allow_headers=["*"], ) if config.enable_ui: import gradio as gr from speaches.gradio_app import create_gradio_demo app = gr.mount_gradio_app(app, create_gradio_demo(config), path="/") return app

          
        
    
    
Copyright Yona authors & © NAVER Corp. & NAVER LABS Supported by NAVER CLOUD PLATFORM

or
Sign in with github login with Google Sign in with Google
Reset password | Sign up