Spaces:
Sleeping
Sleeping
Download config.py from brightmind-ai/test: direct link, hf CLI and curl.
- Browser
- Download file 1.99 kB
-
https://huggingface.co/spaces/brightmind-ai/test/resolve/main/config.py
- Command line
-
hf download hf://spaces/brightmind-ai/test/config.py
-
curl -L -o config.py https://huggingface.co/spaces/brightmind-ai/test/resolve/main/config.py
1.99 kB
| """ | |
| Configuration module for BrightMind AI | |
| Contains all configuration constants and environment variables | |
| """ | |
| import os | |
| # Get Hugging Face token from environment variable | |
| HF_TOKEN = os.getenv("HUGGINGFACE_TOKEN") | |
| # Database configuration | |
| DATABASE_FILE = "feedback.db" | |
| # Email configuration (private) | |
| FEEDBACK_EMAIL = "mahdi@brightmind-ai.com" | |
| SMTP_SERVER = "smtp.gmail.com" | |
| SMTP_PORT = 587 | |
| SMTP_USERNAME = os.getenv("SMTP_USERNAME", "") | |
| SMTP_PASSWORD = os.getenv("SMTP_PASSWORD", "") | |
| # Debug token detection | |
| def debug_token_status(): | |
| """Print debug information about token status""" | |
| print(f"🔍 Token detection debug:") | |
| print(f" - HF_TOKEN exists: {HF_TOKEN is not None}") | |
| print(f" - HF_TOKEN length: {len(HF_TOKEN) if HF_TOKEN else 0}") | |
| print(f" - HF_TOKEN starts with hf_: {HF_TOKEN.startswith('hf_') if HF_TOKEN else False}") | |
| print(f" - SMTP configured: {SMTP_USERNAME != '' and SMTP_PASSWORD != ''}") | |
| # Hugging Face API configuration | |
| HUGGINGFACE_API_URL = "https://api-inference.huggingface.co/models/microsoft/DialoGPT-medium" | |
| HUGGINGFACE_HEADERS = { | |
| "Authorization": f"Bearer {HF_TOKEN}" if HF_TOKEN else None | |
| } | |
| # Content generation settings | |
| DEFAULT_DIFFICULTY = "intermediate" | |
| DEFAULT_QUESTION_COUNT = 5 | |
| DEFAULT_DURATION = 60 | |
| # UI Configuration | |
| PROGRESS_HTML = """ | |
| <div class="progress-container"> | |
| <div class="generation-status">🤖 Generating your lesson plan...</div> | |
| <div class="progress-bar"> | |
| <div class="progress-fill"></div> | |
| </div> | |
| <div class="generation-status">Analyzing requirements and creating content...</div> | |
| </div> | |
| """ | |
| COMPLETION_HTML = """ | |
| <div class="progress-container"> | |
| <div class="generation-status">✅ Lesson Plan Generated Successfully!</div> | |
| </div> | |
| """ | |
| FALLBACK_HTML = """ | |
| <div class="progress-container"> | |
| <div class="generation-status">🔄 Using educational algorithms...</div> | |
| <div class="progress-bar"> | |
| <div class="progress-fill"></div> | |
| </div> | |
| </div> | |
| """ | |