Spaces:
Running
Running
File size: 863 Bytes
1ef4e10 ac40033 1ef4e10 7a295c7 1ef4e10 ac40033 1ef4e10 ac40033 d86a872 1ef4e10 |
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 |
# config.py
import os
from pydantic_settings import BaseSettings
class Config(BaseSettings):
DB_USER: str = os.getenv("DB_USER")
DB_PASSWORD: str = os.getenv("DB_PASSWORD")
DB_HOST: str = os.getenv("DB_HOST", "localhost")
DB_PORT: str = os.getenv("DB_PORT", "3306")
DB_NAME: str = os.getenv("DB_NAME", "defaultdb")
HF_TOKEN: str = os.environ.get("HF_TOKEN")
HF_TTS_DS_REPO: str = os.environ.get("HF_TTS_DS_REPO")
GDRIVE_API_KEY: str = os.environ.get("GDRIVE_API_KEY")
GDRIVE_FOLDER: str = os.environ.get("GDRIVE_FOLDER")
APP_TITLE: str = "Gooya TTS Annotation Tools"
class Config:
env_file = ".env"
case_sensitive = True
@property
def db_url(self) -> str:
return f"mysql+pymysql://{self.DB_USER}:{self.DB_PASSWORD}@{self.DB_HOST}:{self.DB_PORT}/{self.DB_NAME}"
conf = Config()
|