37 lines
757 B
Python
37 lines
757 B
Python
from pydantic_settings import BaseSettings, SettingsConfigDict
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
APP_NAME: str = "AI Moderation"
|
|
|
|
APP_VERSION: str = "1.0.0"
|
|
|
|
HOST: str = "0.0.0.0"
|
|
|
|
PORT: int = 8000
|
|
|
|
DEBUG: bool = True
|
|
|
|
TEXT_TOXIC_THRESHOLD: float = 0.90
|
|
|
|
|
|
# ===== AI =====
|
|
|
|
TEXT_MODEL: str = "textdetox/bert-multilingual-toxicity-classifier"
|
|
|
|
IMAGE_MODEL: str = "Falconsai/nsfw_image_detection"
|
|
NSFW_THRESHOLD: float = 0.85
|
|
IMAGE_CLIP_MODEL: str = "openai/clip-vit-base-patch32"
|
|
CLIP_THRESHOLD: float = 0.75
|
|
HF_TOKEN: str = "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"
|
|
MODEL_CACHE_DIR: str = "./models"
|
|
|
|
DEVICE: str = "auto"
|
|
|
|
model_config = SettingsConfigDict(
|
|
env_file=".env",
|
|
extra="ignore"
|
|
)
|
|
|
|
settings = Settings()
|