Spaces:
Runtime error
Runtime error
| from loguru import logger | |
| from pydantic_settings import BaseSettings, SettingsConfigDict | |
| class Settings(BaseSettings): | |
| model_config = SettingsConfigDict(env_file=".env", env_file_encoding="utf-8") | |
| # Huggingface API | |
| HF_API_KEY: str | None = None | |
| # LlamaParse API | |
| LLAMA_PARSE_API_KEY: str | None = None | |
| # Qdrant vector database | |
| USE_QDRANT_CLOUD: bool = False | |
| QDRANT_DATABASE_HOST: str = "localhost" | |
| QDRANT_DATABASE_PORT: int = 6333 | |
| QDRANT_CLOUD_URL: str = "str" | |
| QDRANT_APIKEY: str | None = None | |
| # RAG | |
| TEXT_EMBEDDING_MODEL_ID: str = "sentence-transformers/all-MiniLM-L6-v2" | |
| RERANKING_CROSS_ENCODER_MODEL_ID: str = "cross-encoder/ms-marco-MiniLM-L-4-v2" | |
| RAG_MODEL_DEVICE: str = "cpu" | |
| def load_settings(cls) -> "Settings": | |
| """ | |
| Tries to load the settings from the ZenML secret store. If the secret does not exist, it initializes the settings from the .env file and default values. | |
| Returns: | |
| Settings: The initialized settings object. | |
| """ | |
| settings = Settings() | |
| return settings | |
| settings = Settings.load_settings() | |