Spaces:
Running
Running
File size: 1,370 Bytes
41979e6 e4a7287 6a4e9e3 fe4903b 41979e6 6a4e9e3 fe4903b e4a7287 fe4903b e4a7287 6a4e9e3 fe4903b e4a7287 fe4903b e4a7287 fe4903b 6a4e9e3 e4a7287 fe4903b 6a4e9e3 fe4903b 6a4e9e3 fe4903b 6a4e9e3 fe4903b 41979e6 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
import os
from pathlib import Path
from pydantic_settings import BaseSettings
from typing import ClassVar, Optional
class Settings(BaseSettings):
"""Uygulama genelinde kullanılan ayarlar."""
# Temel ayarlar
ENVIRONMENT: str = "production"
DEBUG: bool = False
ENCRYPTION_KEY: str = os.environ.get("ENCRYPTION_KEY", "your-secret-key-here")
API_PREFIX: str = "/api/v1"
# Hugging Face ayarları
HF_TOKEN = os.environ.get("HF_TOKEN", "")
HF_CACHE_DIR = Path("/root/.cache/huggingface")
# ASR ayarları
ASR_MODEL: str = "openai/whisper-small"
DIARIZATION_MODEL: str = "pyannote/speaker-diarization-3.0"
ANONYMIZE_DATA: bool = True
ENHANCE_AUDIO: bool = True
# Dosya ayarları
MAX_UPLOAD_SIZE: int = 25 * 1024 * 1024 # 25 MB
ALLOWED_EXTENSIONS: set[str] = {"wav", "mp3", "m4a", "ogg"}
# Dil ayarları
LANGUAGE: str = "tr"
SPACY_MODEL: str = "tr_core_news_sm"
# Özel tıbbi terimler dosyası
MEDICAL_TERMS_FILE: str = "medical_terms.json"
# Diarization ayarları
MIN_SPEAKER_DURATION: float = 1.0
MAX_SPEAKERS: int = 5
SAMPLE_RATE: int = 16000
# Cache ayarları
CACHE_DIR: Path = Path("/tmp/voice_to_write_cache")
class Config:
env_file = ".env"
env_file_encoding = "utf-8"
settings = Settings()
|