Seicas commited on
Commit
fe4903b
·
verified ·
1 Parent(s): 14e4ceb

Update config.py

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