Spaces:
Sleeping
Sleeping
Refactor: Production-grade modular layout, NLTK permissions fix, and editorial audit dashboard overhaul
405a3f0 Download src/config.py from amadmateen/SentinelReview-AI: direct link, hf CLI and curl.
- Browser
- Download file 684 Bytes
-
https://huggingface.co/spaces/amadmateen/SentinelReview-AI/resolve/main/src/config.py
- Command line
-
hf download hf://spaces/amadmateen/SentinelReview-AI/src/config.py
-
curl -L -o config.py https://huggingface.co/spaces/amadmateen/SentinelReview-AI/resolve/main/src/config.py
684 Bytes
| import os | |
| import torch | |
| # Base directory resolution | |
| BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) | |
| # Resource directory paths | |
| DATA_DIR = os.path.join(BASE_DIR, "data") | |
| MODEL_DIR = os.path.join(BASE_DIR, "models") | |
| MODEL_PATH = os.path.join(MODEL_DIR, "DistilBert_resnet.pth") | |
| # Server settings | |
| MAX_CONTENT_LENGTH = 16 * 1024 * 1024 # 16MB max upload size | |
| # Hugging Face token resolution | |
| HF_TOKEN = os.environ.get("HF_TOKEN") | |
| # Dynamic hardware device mapping (CUDA -> MPS -> CPU) | |
| if torch.cuda.is_available(): | |
| DEVICE = torch.device("cuda") | |
| elif torch.backends.mps.is_available(): | |
| DEVICE = torch.device("mps") | |
| else: | |
| DEVICE = torch.device("cpu") | |