Spaces:
Running
Running
set-up
#1
by
SamiaHaque
- opened
- .gitignore +4 -0
- requirements.txt +13 -1
- src/config.py +23 -0
.gitignore
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
__pycache__/
|
2 |
+
*.pyc
|
3 |
+
harmsense/
|
4 |
+
.env
|
requirements.txt
CHANGED
@@ -1 +1,13 @@
|
|
1 |
-
huggingface_hub==0.25.2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
huggingface_hub==0.25.2
|
2 |
+
torch
|
3 |
+
torchvision
|
4 |
+
gradio
|
5 |
+
requests
|
6 |
+
transformers
|
7 |
+
accelerate
|
8 |
+
Pillow
|
9 |
+
python-dotenv
|
10 |
+
numpy
|
11 |
+
opencv-python
|
12 |
+
bitsandbytes
|
13 |
+
pydantic
|
src/config.py
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
+
from dotenv import load_dotenv
|
3 |
+
|
4 |
+
load_dotenv()
|
5 |
+
|
6 |
+
class Config:
|
7 |
+
"""Application configuration class."""
|
8 |
+
|
9 |
+
# Hugging Face Configuration
|
10 |
+
HF_TOKEN = os.getenv("HF_TOKEN")
|
11 |
+
|
12 |
+
# Model Configuration
|
13 |
+
DETR_MODEL_NAME = "facebook/detr-resnet-50"
|
14 |
+
QWEN_MODEL_NAME = "Qwen/Qwen2.5-Omni-7B"
|
15 |
+
|
16 |
+
@classmethod
|
17 |
+
def validate_config(cls):
|
18 |
+
"""Validate the configuration values."""
|
19 |
+
if not cls.HF_TOKEN:
|
20 |
+
raise ValueError("HF_TOKEN is not set in the environment variables.")
|
21 |
+
|
22 |
+
# Validate configuration on import
|
23 |
+
Config.validate_config()
|