Spaces:
Sleeping
Sleeping
Download config.py from hamzagssima/psychocrowd-api: direct link, hf CLI and curl.
- Browser
- Download file 4 kB
-
https://huggingface.co/spaces/hamzagssima/psychocrowd-api/resolve/main/config.py
- Command line
-
hf download hf://spaces/hamzagssima/psychocrowd-api/config.py
-
curl -L -o config.py https://huggingface.co/spaces/hamzagssima/psychocrowd-api/resolve/main/config.py
4 kB
| # config.py | |
| """Central configuration for the PsychoCrowd project.""" | |
| import os | |
| from pathlib import Path | |
| from dotenv import load_dotenv | |
| load_dotenv() | |
| # ββ Paths ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| BASE_DIR = Path(__file__).parent | |
| DATA_DIR = BASE_DIR / "data" | |
| OUTPUTS_DIR = BASE_DIR / "outputs" | |
| PLOTS_DIR = OUTPUTS_DIR / "plots" | |
| MCQ_PATH = DATA_DIR / "mcq_bank.csv" | |
| HUMAN_PATH = DATA_DIR / "human_responses.csv" | |
| # ββ LLM API Keys & Endpoints βββββββββββββββββββββββββββββββββββββββββββ | |
| # Load from environment variables. They are NOT hardcoded. | |
| OPENROUTER_API_KEY = os.getenv("OPENROUTER_API_KEY", "") | |
| N8N_WEBHOOK_URL = os.getenv("N8N_WEBHOOK_URL", "") | |
| GEMINI_API_KEY = os.getenv("GEMINI_API_KEY", "") | |
| GEMINI_MODEL = "gemini-2.5-flash" | |
| GEMINI_DELAY_SEC = 1.0 | |
| GEMINI_MAX_RETRY = 3 | |
| GEMINI_RETRY_WAIT = 10 | |
| DEEPSEEK_API_KEY = os.getenv("DEEPSEEK_API_KEY", "") | |
| DEEPSEEK_MODEL = "deepseek-chat" | |
| # ββ Model Configuration βββββββββββββββββββββββββββββββββββββββββββββββββ | |
| # This allows easy switching and holds model-specific details | |
| SOLVER_CONFIG = { | |
| "n8n": { | |
| "api_key": OPENROUTER_API_KEY, # The n8n solver will use this key | |
| "webhook_url": N8N_WEBHOOK_URL, | |
| "available_models": { | |
| "DeepSeek Coder V2": "deepseek/deepseek-coder-v2-lite-instruct", | |
| "Kimi (Moonshot)": "moonshot/moonshot-v1-8k", | |
| "Claude 3.5 Sonnet": "anthropic/claude-3.5-sonnet", | |
| "GPT-4o": "openai/gpt-4o" | |
| } | |
| } | |
| } | |
| # ββ Supabase ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| SUPABASE_URL = os.getenv("SUPABASE_URL", "") | |
| SUPABASE_KEY = os.getenv("SUPABASE_KEY", "") | |
| # ββ Mock data parameters ββββββββββββββββββββββββββββββββββββββββββββββββ | |
| MOCK_N_ITEMS = 1000 | |
| MOCK_N_HUMANS = 200 | |
| MOCK_RANDOM_SEED = 42 | |
| # ββ Student profiles ββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| PROFILES = { | |
| "expert": +0.20, | |
| "good": +0.05, | |
| "medium": -0.10, | |
| "weak": -0.30, | |
| } | |
| N_STUDENTS_PER_PROFILE = 50 # 4 profiles Γ 50 = 200 artificial students | |
| # ββ Performance targets by difficulty ββββββββββββββββββββββββββββββββββ | |
| PROFILE_TARGETS = { | |
| # easy medium hard | |
| "weak": [0.45, 0.30, 0.15], | |
| "medium": [0.70, 0.55, 0.35], | |
| "good": [0.85, 0.75, 0.60], | |
| "expert": [0.97, 0.93, 0.85], | |
| } | |
| # ββ Rasch model βββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| RASCH_MAX_ITER = 200 | |
| RASCH_TOL = 1e-6 | |
| # ββ Visualization βββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| PLOT_STYLE = "seaborn-v0_8-whitegrid" | |
| PLOT_FIGSIZE = (11, 7) | |
| PLOT_DPI = 150 | |
| BRAND_COLORS = { | |
| "primary": "#1B3A6B", # navy | |
| "secondary": "#00A8CC", # cyan | |
| "accent": "#7B2FBE", # violet | |
| "human": "#E63946", # red | |
| "artificial": "#2EC4B6", # teal | |
| "weak": "#FF6B6B", | |
| "medium": "#FFD166", | |
| "good": "#06D6A0", | |
| "expert": "#118AB2", | |
| } | |