Spaces:
Running on Zero
Running on Zero
| """ | |
| Central configuration for NLP4ASD. | |
| Change values here to switch models, paths, or behavior globally. | |
| """ | |
| import os | |
| # --- Paths --- | |
| BASE_DIR = os.path.dirname(os.path.abspath(__file__)) | |
| DATA_RAW_DIR = os.path.join(BASE_DIR, "data", "raw") | |
| DATA_PROCESSED_DIR = os.path.join(BASE_DIR, "data", "processed") | |
| VECTOR_INDEX_PATH = os.path.join(DATA_PROCESSED_DIR, "faiss_index") | |
| CHUNKS_PATH = os.path.join(DATA_PROCESSED_DIR, "chunks.json") | |
| METADATA_PATH = os.path.join(BASE_DIR, "data", "sources_metadata.json") | |
| # --- Embeddings --- | |
| EMBEDDING_MODEL = "sentence-transformers/all-MiniLM-L6-v2" | |
| EMBEDDING_DIM = 384 | |
| # --- Chunking --- | |
| CHUNK_SIZE = 512 # characters per chunk | |
| CHUNK_OVERLAP = 64 # overlap between chunks | |
| # --- Retrieval --- | |
| TOP_K = 4 # number of chunks to retrieve | |
| # --- Generation --- | |
| # Lightweight model suitable for Hugging Face Spaces (CPU-friendly) | |
| # Switch to "BioMistral/BioMistral-7B", "google/gemma-2b-it", etc. as needed | |
| GENERATOR_MODEL = "google/flan-t5-base" | |
| MAX_NEW_TOKENS = 512 | |
| TEMPERATURE = 0.3 | |
| # --- User Profiles --- | |
| PROFILES = [ | |
| "Parent", | |
| "Patient / Autistic person", | |
| "Healthcare Professional", | |
| "Teacher / Educator", | |
| "Researcher", | |
| ] | |
| # --- Languages --- | |
| LANGUAGES = ["English", "French"] | |
| # --- Disclaimer (appended to all answers) --- | |
| DISCLAIMER = ( | |
| "⚠️ This information is based on retrieved scientific sources and is for " | |
| "informational purposes only. It does not replace professional medical advice." | |
| ) | |