start ai-moderation
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
import logging
|
||||
|
||||
logging.basicConfig(
|
||||
level=logging.INFO,
|
||||
format="%(asctime)s %(levelname)s %(message)s",
|
||||
handlers=[
|
||||
logging.StreamHandler()
|
||||
]
|
||||
)
|
||||
|
||||
logger = logging.getLogger("ai-moderation")
|
||||
@@ -0,0 +1,29 @@
|
||||
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
|
||||
|
||||
# ===== AI =====
|
||||
|
||||
TEXT_MODEL: str = "textdetox/bert-multilingual-toxicity-classifier"
|
||||
|
||||
|
||||
MODEL_CACHE_DIR: str = "./models"
|
||||
|
||||
DEVICE: str = "auto"
|
||||
|
||||
model_config = SettingsConfigDict(
|
||||
env_file=".env",
|
||||
extra="ignore"
|
||||
)
|
||||
|
||||
settings = Settings()
|
||||
|
||||
Reference in New Issue
Block a user