Spaces:
Running
Running
phase 2 init
Browse files
config.py
CHANGED
@@ -1,10 +1,12 @@
|
|
1 |
# config.py
|
2 |
|
3 |
import os
|
4 |
-
from pydantic_settings import BaseSettings
|
5 |
|
6 |
|
7 |
class Config(BaseSettings):
|
|
|
|
|
8 |
DB_USER: str = os.getenv("DB_USER")
|
9 |
DB_PASSWORD: str = os.getenv("DB_PASSWORD")
|
10 |
DB_HOST: str = os.getenv("DB_HOST", "localhost")
|
@@ -25,16 +27,12 @@ class Config(BaseSettings):
|
|
25 |
# Phase 2 Review Mapping: Defines who reviews whose work.
|
26 |
# Key: Original annotator's username, Value: Reviewer's username
|
27 |
REVIEW_MAPPING: dict[str, str] = {
|
28 |
-
|
29 |
-
|
30 |
# "mohsen": "sepehr",
|
31 |
# "sepehr": "mohammad"
|
32 |
}
|
33 |
|
34 |
-
class Config:
|
35 |
-
env_file = ".env"
|
36 |
-
case_sensitive = True
|
37 |
-
|
38 |
@property
|
39 |
def db_url(self) -> str:
|
40 |
# If no DB_USER is provided, use SQLite for local testing
|
|
|
1 |
# config.py
|
2 |
|
3 |
import os
|
4 |
+
from pydantic_settings import BaseSettings, SettingsConfigDict
|
5 |
|
6 |
|
7 |
class Config(BaseSettings):
|
8 |
+
model_config = SettingsConfigDict(env_file=".env", case_sensitive=True)
|
9 |
+
|
10 |
DB_USER: str = os.getenv("DB_USER")
|
11 |
DB_PASSWORD: str = os.getenv("DB_PASSWORD")
|
12 |
DB_HOST: str = os.getenv("DB_HOST", "localhost")
|
|
|
27 |
# Phase 2 Review Mapping: Defines who reviews whose work.
|
28 |
# Key: Original annotator's username, Value: Reviewer's username
|
29 |
REVIEW_MAPPING: dict[str, str] = {
|
30 |
+
"zahra2": "mohsen",
|
31 |
+
"mohsen": "zahra2",
|
32 |
# "mohsen": "sepehr",
|
33 |
# "sepehr": "mohammad"
|
34 |
}
|
35 |
|
|
|
|
|
|
|
|
|
36 |
@property
|
37 |
def db_url(self) -> str:
|
38 |
# If no DB_USER is provided, use SQLite for local testing
|