-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
36 lines (27 loc) · 811 Bytes
/
config.py
File metadata and controls
36 lines (27 loc) · 811 Bytes
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
from pathlib import Path
from dotenv import load_dotenv
import os
load_dotenv()
BASE_DIR = Path(__file__).parent
DATA_DIR = BASE_DIR / "data"
INDEX_DIR = DATA_DIR / "index"
DOCS_DIR = DATA_DIR / "docs"
# Ensure data dirs exist
INDEX_DIR.mkdir(parents=True, exist_ok=True)
DOCS_DIR.mkdir(parents=True, exist_ok=True)
# FAISS index files
FAISS_INDEX_PATH = INDEX_DIR / "physics.index"
METADATA_PATH = INDEX_DIR / "metadata.pkl"
# Embeddings
EMBEDDING_MODEL = "all-MiniLM-L6-v2"
EMBEDDING_DIM = 384
# Chunking
CHUNK_SIZE = 1200 # characters
CHUNK_OVERLAP = 200 # characters
# Ollama
OLLAMA_BASE_URL = os.getenv("OLLAMA_BASE_URL", "http://localhost:11434")
OLLAMA_MODEL = os.getenv("OLLAMA_MODEL", "mistral")
# Retrieval
TOP_K = 5 # chunks to retrieve
# arXiv
ARXIV_MAX_RESULTS = 5