Spaces:
Running on Zero
Running on Zero
File size: 1,496 Bytes
d10de1b 0bdd27b d10de1b | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | """
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."
)
|