| | """Configuration settings for the API""" |
| |
|
| | import os |
| | from pathlib import Path |
| | from dotenv import load_dotenv |
| |
|
| | |
| | load_dotenv() |
| |
|
| | |
| | API_DIR = Path(__file__).parent |
| | PROJECT_ROOT = API_DIR.parent |
| |
|
| | |
| | HUGGINGFACE_API_KEY = os.getenv("HUGGINGFACE_API_KEY", "") |
| | HUGGINGFACE_MODEL_ID = os.getenv("HUGGINGFACE_MODEL_ID", "yassine-mhirsi/debertav3-stance-detection") |
| |
|
| | |
| | |
| | STANCE_MODEL_ID = HUGGINGFACE_MODEL_ID |
| |
|
| | |
| | API_TITLE = "NLP Project API" |
| | API_DESCRIPTION = "API for various NLP models including stance detection and more" |
| | API_VERSION = "1.0.0" |
| |
|
| | |
| | HOST = os.getenv("HOST", "0.0.0.0") |
| | PORT = int(os.getenv("PORT", "7860")) |
| | RELOAD = os.getenv("RELOAD", "False").lower() == "true" |
| |
|
| | |
| | CORS_ORIGINS = ["*"] |
| | CORS_CREDENTIALS = True |
| | CORS_METHODS = ["*"] |
| | CORS_HEADERS = ["*"] |
| |
|