Spaces:
Runtime error
Runtime error
Download app/core/config.py from AsyncCoder-10/my-moderation-api: direct link, hf CLI and curl.
- Browser
- Download file 552 Bytes
-
https://huggingface.co/spaces/AsyncCoder-10/my-moderation-api/resolve/main/app/core/config.py
- Command line
-
hf download hf://spaces/AsyncCoder-10/my-moderation-api/app/core/config.py
-
curl -L -o config.py https://huggingface.co/spaces/AsyncCoder-10/my-moderation-api/resolve/main/app/core/config.py
552 Bytes
| from pydantic_settings import BaseSettings | |
| from functools import lru_cache | |
| class Settings(BaseSettings): | |
| openai_api_key: str # Keep for potential LLM rewrites | |
| groq_api_key: str # Keep for potential LLM rewrites | |
| moderation_threshold: float = 0.5 | |
| # Use a Hugging Face model ID | |
| hf_moderation_model: str = "textdetox/bert-multilingual-toxicity-classifier" | |
| chat_model: str = "openai/gpt-oss-20b" | |
| class Config: | |
| env_file = ".env" | |
| def get_settings() -> Settings: | |
| return Settings() | |