mirror of
https://github.com/remsky/Kokoro-FastAPI.git
synced 2025-08-05 16:48:53 +00:00

- Set up FastAPI application with TTS service - Define API endpoints for TTS generation and voice listing - Implement Pydantic models for request and response schemas - Add Dockerfile and docker-compose.yml for containerization - Include example usage and benchmark results in README
23 lines
537 B
Python
23 lines
537 B
Python
from pydantic_settings import BaseSettings
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
# API Settings
|
|
api_title: str = "Kokoro TTS API"
|
|
api_description: str = "API for text-to-speech generation using Kokoro"
|
|
api_version: str = "1.0.0"
|
|
host: str = "0.0.0.0"
|
|
port: int = 8880
|
|
|
|
# TTS Settings
|
|
output_dir: str = "output"
|
|
default_voice: str = "af"
|
|
model_path: str = "kokoro-v0_19.pth"
|
|
voices_dir: str = "voices"
|
|
sample_rate: int = 24000
|
|
|
|
class Config:
|
|
env_file = ".env"
|
|
|
|
|
|
settings = Settings()
|