askmydoc / apps /core /config.py
faizan20's picture
Initial commit
d9e9326
# app/core/config.py
import os
from pathlib import Path
from dotenv import load_dotenv
# === PATH CONFIG ===
BASE_DIR = Path(__file__).resolve().parent.parent
ENV_PATH = Path("D:/pythonProject7/.env") # βœ… Explicit path that works
# βœ… Force-load .env (same as your working test)
load_dotenv(dotenv_path=ENV_PATH)
DATA_DIR = BASE_DIR / "data"
UPLOAD_DIR = DATA_DIR / "uploads"
VECTOR_STORE_PATH = DATA_DIR / "vector_store"
UPLOAD_DIR.mkdir(parents=True, exist_ok=True)
DATA_DIR.mkdir(parents=True, exist_ok=True)
# === MODEL CONFIG ===
EMBEDDING_MODEL = os.getenv("EMBEDDING_MODEL", "sentence-transformers/all-MiniLM-L6-v2")
LLM_MODEL = os.getenv("LLM_MODEL", "mistralai/Mistral-7B-Instruct-v0.2")
HF_TOKEN = os.getenv("HUGGINGFACEHUB_API_TOKEN")
# === Optional Debug Print ===
if not HF_TOKEN:
print("⚠️ Token not loaded β€” model inference will fail.")
else:
print("βœ… Hugging Face token loaded successfully.")
# === APP METADATA ===
APP_NAME = "AskMyDocs"
DESCRIPTION = "Upload your files. Ask anything. Get precise, AI-powered answers with Retrieval-Augmented Generation (RAG) β€” built using LangChain and Streamlit."
VERSION = "1.0.0"